betterer
betterer copied to clipboard
feature idea: apply eslint rule config options
I have an eslint rule that uses additional configuration options.
Currently I have to maintain this (duplicated) configuration in two places, .eslintrc.json + .betterer.ts.
Example:
eslintrc.json:
"import/no-restricted-paths": [
"warn",
{
"basePath": "./src/app",
"zones": [
...
]
}
],
.betterer.ts:
'import/no-restricted-paths': ['error', { ... }],
Obviously I want to keep my code DRY, so ideally .betterer would figure out that the rule exists in eslint.json and apply the additional options, such that it's enough to just write:
'import/no-restricted-paths': 'error',
So by default it would just take the already existing options from .eslintrc.json, but if I were to provide options also inside .betterer.ts then obviously it would just override (or merge?) those from eslint.
What is the reason behind keeping the ESLint warnings as well? Seems to me like that will makes things noisy without much benefit?
I want my IDE to warn me about the violations, so I still know that I'm doing something wrong
Are you using VSCode? https://marketplace.visualstudio.com/items?itemName=Betterer.betterer-vscode
I am but my team mates are on Web storm :) It's not a big deal, just a minor annoyance I guess. Just have to remember to update both places.