0

I have tons of little projects that come and go and I don’t want to always have to create a .eslintrc file in my root dir or do any other special configuration to get my default lint settings to work.

After a few hours of googling and getting nowhere — I finally found one way to share the eslint settings across multiple Sublime projects that seems to work - just put the .eslintrc file in the parent directory of my projects. SublimeLinter seems smart enough to find it there.

I'm publishing this as one possible way to maybe help someone else in my predicament. I feel like maybe I'm doing something wrong though and there could be a better way?

ESLint offers sharable configs, which make things a little easier but still involve work for each project that wants to use them.

MattS
  • 173
  • 1
  • 9

1 Answers1

1

You can create a .eslintrc file in your home directory, and ESLint will use that as a fallback for any projects that don't specify their own .eslintrc. This is perfect for quick, temporary projects that you create. You can read more in the configuration cascade docs.

If any of them advance to a point where you want to collaborate with other developers, only then do you need to configure a project-specific .eslintrc to make sure that all collaborators are using the same configuration.

btmills
  • 4,431
  • 24
  • 22
  • Replying since I don't have enough reputation to upvote heh. Ok so yeah pretty similar to what I did with putting it one directory up. Thanks. I swear everything I could find by googling just seemed to assume you'd want a new .eslintrc for every project and made no mention of how to do some kind of global settings. Hence I made this post. Hopefully others in my predicament will find it some day. The other tricky part was updating ES Lint to recognize async/await that's been available in node since version 8. Feels like that could be easier. https://github.com/eslint/eslint/issues/10127 – MattS Oct 11 '18 at 18:19
  • I missed that configuration cascade part of the docs somehow. – MattS Oct 11 '18 at 18:25