eslint-plugin-square
eslint-plugin-square copied to clipboard
Extending multiple configs can cause conflicts
Let's say a consumer extends two of our configs like this:
extends: ['plugin:square/ember', 'plugin:square/typescript']
Here's an example of a problem that can happen:
-
ember
config loads which extends thebase
config: 1a.base
config turns various linting on including thearray-callback-return
rule 1b.ember
config configures various linting including turning off thearray-callback-return
rule off for a certain file -
typescript
config loads which extends thebase
config: 2a.base
config loads again which turns thearray-callback-return
rule BACK ON everywhere (this breaks the intended behavior of theember
config) 2b.typescript
config configures various linting
Possible fixes:
- Stop extending
base
config automatically with all our configs. That would then require consumers to specify thebase
config first before other configs would they might forget to do. - Somehow prevent the
base
config from being loaded multiple times (if it could detect that it has already been loaded by a previous config). - ?