Some rules cannot be parsed when used in a separate eslint plugin inside yarn workspace
azhiv opened this issue · comments
After adding decorator-position plugin to my app eslint stopped working with an error like below:
ESLint: 7.9.0
Error: Error while loading rule 'decorator-position/decorator-position': .eslintrc.js » plugin:example/base:
Configuration for rule "camelcase" is invalid:
Value {"properties":"never","ignoreDestructuring":false,"ignoreImports":false,"ignoreGlobals":false} should NOT have additional properties.
Occurred while linting /Users/artemz/src/eslint-issue/main-app/.eslintrc.js
at validateRuleOptions (/Users/artemz/src/eslint-issue/node_modules/eslint-plugin-decorator-position/node_modules/eslint/lib/shared/config-validator.js:132:19)
at Object.keys.forEach.id (/Users/artemz/src/eslint-issue/node_modules/eslint-plugin-decorator-position/node_modules/eslint/lib/shared/config-validator.js:187:9)
at Array.forEach (<anonymous>)
at validateRules (/Users/artemz/src/eslint-issue/node_modules/eslint-plugin-decorator-position/node_modules/eslint/lib/shared/config-validator.js:184:30)
at validateConfigArray (/Users/artemz/src/eslint-issue/node_modules/eslint-plugin-decorator-position/node_modules/eslint/lib/shared/config-validator.js:312:9)
at CascadingConfigArrayFactory._finalizeConfigArray (/Users/artemz/src/eslint-issue/node_modules/eslint-plugin-decorator-position/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:464:13)
at CascadingConfigArrayFactory.getConfigArrayForFile (/Users/artemz/src/eslint-issue/node_modules/eslint-plugin-decorator-position/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js:275:21)
at CLIEngine.getConfigForFile (/Users/artemz/src/eslint-issue/node_modules/eslint-plugin-decorator-position/node_modules/eslint/lib/cli-engine/cli-engine.js:933:14)
at lineLength (/Users/artemz/src/eslint-issue/node_modules/eslint-plugin-decorator-position/lib/rules/decorator-position.js:327:35)
at Object.decoratorPositionRule [as create] (/Users/artemz/src/eslint-issue/node_modules/eslint-plugin-decorator-position/lib/rules/decorator-position.js:138:27)
error Command failed with exit code 2.
If I remove the plugin or the camelcase
rule configuration the error goes away.
I created a reproduction repo to play around with the configuration.
PS The file it tries to lint eslint-issue/main-app/.eslintrc.js
is not specific - reconfiguring the rule to be applied to files with another filter (*.ts for instance) yields the same result.
can you submit a failing test PR?
I think I re-created your issue here: 99e423a
Here is the fix: d14c936
},
plugins: [
'ember',
+ 'decorator-position',
'example',
],
extends: [
Note: I commented out the "example" plugin, because I didn't think the yarn workspace was relevant to reproducing the issue. If it is still an issue, lemme know