Only use certain eslint config

I have a project that has an eslint config file.  It has certain project settings like tabs instead of spaces, and 4 space indent.  However, my preference is spaces and 2 space indent, so what I'd like to do is have my own eslint config file that has my preferences and ignores any project's settings.  I've been playing around with Code Quality Tools > ESLint by changing the working directory and configuration file location to outside of my project's scope, but it still picks up the project's eslint config and throws a conflict error.

Is this possible to configure in WebStorm?

0
6 comments

placing the configuration file to some folder external to the project won't work. You can try creating a config file with a different name next to your project config and choose this config in settings

0

Okay, so I followed your advice, and I think I did it correctly (see attached image), but it's still using the project's .eslintrc.json file, and I've closed/opened WS.

0

ESLint uses a configuration cascade, meaning it traverses up as far as it can, merging configs as it goes. In your project .eslintrc.local.json, you can add { "root": true } to limit ESLint's config search  - does it help?

0

It doesn't help, as I already had that in the config file.

0

No more ideas then:(

0

I may have tricked the IDE... I deleted the .eslintrc.json file, and it then successfully picked up the .estlintrc.local.json file.  I then restored .eslintrc.json from git, and it's still using the local json file, which is what I want.  I'm wondering if there's some kind of bug in there somewhere... either way, it does appear to be working now.  Thanks for the troubleshooting help, Elena Pogorelova!

0

Please sign in to leave a comment.