eslintrc.js file does not seem to be used

Hi all,

We are trying to use custom eslint rules (later on the idea is to use our own plugin).

We followed the documentation and created a .eslintrc.js file with, as a very basic test, the following code:

module.exports = {
rules: {
"quotes": [2, "single"]
}
};

This is at the root of our webstorm project.

Then we went to preferences to set the eslint config:

The rule is strangely working in the eslintrc.js file but nowhere else (same folder level, nor children folders). eslint is working since it triggers standard errors, but the rules defined in the eslintrc.js file is not used.

 

Any idea what is going on ? We are using webstorm 2021.1.1

 

Thanks a lot for your help !

 

1
4 comments

Works fine for me

Do you have any other .eslintrc* files in your project? Does it help if you choose Manual ESLint configuration and set it up explicitly?

0

Hello, thanks for your reply.

I think I found what happens : it is indeed working, but for some reasons webstorm is stopping at eslint errors that are before my test code. I was testing in a file with an "import" statement, and no parser defined, so eslint is throwing an error at the import statement, and not showing the error for the double quotes.

Thanks a lot for your answer !

 

 

0

> for some reasons webstorm is stopping at eslint errors that are before my test code.

 

this is not WebStorm, but ESLint itself - if a parser error occurs when processing a certain file, no issues (except for parser errors) are reported for this file, as linting don't work reliably if the file can't be parsed. You will face the same problem when running eslint in command line with eslint <your file name> command

0

ok got it, thanks a lot !

0

Please sign in to leave a comment.