config-inspector
config-inspector copied to clipboard
Detect usage of deprecated rules
It would be great to have a CLI to retrieve the list of deprecated rules activated (warn
/error
).
With that it would be easy to detect when some rules became deprecated while upgrading ESLint plugins versions.
The rule could be well deactivated if it is set to off
for the same set or a superset of files compare to the set of files for which it is activated.
e.g.
[
// Config coming from an external ESLint plugin
{
rules: {
'my-deprecated-rule-1': 'warn',
...
},
files: ['**/*.{c,m,}{t,j}s']
},
// Local overrides
{
rules: {
'my-deprecated-rule-1': 'off',
...
},
files: ['**/*']
},
{
rules: {
'my-deprecated-rule-2': 'off',
...
},
files: ['**/*.ts']
}
]
In this case my-deprecated-rule-1
is well deactivated but my-deprecated-rule-2
is not because still activated for ['**/*.{c,m,}js', '**/*.{c,m}ts']
It also could be great to detect "useless overloaded" rules e.g.
[
// Config coming from an external ESLint plugin
{
rules: {
'my-rule': ['error', { configItem: 1 }]
}
},
// Local override
{
rules: {
'my-rule': ['error', { configItem: 1 }]
}
}
]
In this case I want to be aware that my local override is useless as it's already configured like that (only if the glob of the override is equal or a subset of the one defined in configuration from the plugin)