Different ESLint configurations for different project folders

Hi! I was googling and couldn't find anything (maybe i'm asking  the wrong questions) so I decided to go on your forums for help. Is there any way I could configure WebStorm to use different ESLint rules for different folders? Like I want Airbnb and AngularJS Style guide eslint rules for the folder "client" and only Airbnb styleguide for the folder "backend". I do have both style guides in now, but I dont like the way AngularJS Style guide puts errors on the backend code. Is it possible now or should I make a request somewhere?

 

5 comments
Comment actions Permalink

I forgot to mention I have this implemented with Webpack already, so when I change the files I get ESLint if there are any errors, but I love the way Webstorm puts it on the code directly like microsoft Word with spelling, so you can fix faster without having to wait for console to display results.

0
Comment actions Permalink

You can have multiple .eslintrc files in your project, one for each of your folders - see http://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy. Make sure that 'Configuration file' is set to 'Automatic search' in your ESLint preferences

0
Comment actions Permalink

I was wrong with my solution with webpack, this is certanly easier and it works in WebStorm. Thank you Elena!

0
Comment actions Permalink

I know this is an old thread, but.. Different configurations are possible, however the problem is libraries.

Example: I have project Foo-react and Foo-react-native, they are both node project and have separate package.json files. I have different .eslintrc for each, and I want to extend different configurations. I can see that in Eslint settings it is possible to select eslint package (Foo-react or Foo-react-native, or global), but is it possible to do it per module?

1

Please sign in to leave a comment.