In my eslint
config (YAML
format), I'm extending 3 different configurations:
extends:
- airbnb-base
- plugin:angular/johnpapa
- ionic
My questions are as follows:
YAML
?eslint:recommended
): will I get the same error multiple times if the error is related to one of these "shared" rules?extends uses a config file which applies set of rules when you add that to the extends options. A plugin on the other hand provides you with a set of rules that you can individually apply depending on your need. Just having a plugin does not enforce any rule. You have to choose which rules you need.
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). As such, any new rules must be deemed of high importance to be considered for inclusion in ESLint.
I defines the severity of a rule. Severity should be one of the following: 0 = off, 1 = warning, 2 = error (you passed "3"). Documentation: https://eslint.org/docs/user-guide/configuring/rules.
At first, Yes, it's the correct format in YAML (see for example ESLint - Configuring Plugins). As JSON, it would be
{
"extends": [
"airbnb-base",
"plugin:angular/johnpapa",
"ionic"
]
}
If you have multiple rulesets in your extend
section, each following ruleset will extend or overwrite the previous ones. So you will only have one setting for each rule (see ESLint - Extending Configuration Files) Sometimes when the rules from the shareable configs are conflicting and you can't define a specific order for the extend
section you have to manually define this specific rule in you rules
section.
So the answer to you second question is: No, you won't get the same error multiple times.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With