Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find the rule definitions for "eslint:recommended"?

Tags:

eslint

rules

In a .eslintrc file, we can use:

"extends": "eslint:recommended" 

to extend the recommended rules provided by eslint, and in the rule list, many of them are marked as "recommended".

My question what is the exact rule definitions for them? I searched in the repo of eslint, but not found it.

like image 429
Freewind Avatar asked Oct 16 '15 03:10

Freewind


People also ask

How do you define rules for ESLint?

ESLint comes with a large number of built-in rules and you can add more rules through plugins. You can modify which rules your project uses either using configuration comments or configuration files. To change a rule setting, you must set the rule ID equal to one of these values: "off" or 0 - turn the rule off.

How many ESLint rules are there?

Keep in mind that we have over 200 rules, and that is daunting both for end users and the ESLint team (who has to maintain them).

Where can I find Eslintrc?

Go to settings --> packages --> linter-eslint settings. On that menu, look for the . eslintrc Path option.

Where is ESLint config?

The ESLint configuration is in the ./node_modules/@spm/eslint-config/index. js file.


2 Answers

Freewind's answer is pointing to a specific commit – now outdated.

The current eslint:recommended rules can be found at github.com/eslint/eslint/blob/master/conf/eslint-recommended.js.

like image 112
ChrisV Avatar answered Sep 21 '22 16:09

ChrisV


Run this terminal command from the project root to output a complete list of definitions being applied in your setup.

./node_modules/.bin/eslint --print-config *.* > "./.eslintrc.js_fullsettings.js" 

If you only have extends: ['eslint:recommended'] in the .eslint file you'll get what you're looking for.

like image 44
GollyJer Avatar answered Sep 17 '22 16:09

GollyJer