fix: 🐛 'off' rule level being overridden
This commit is contained in:
@@ -69,17 +69,19 @@ function iterateRules(rules, handler) {
|
|||||||
function createVariations(config) {
|
function createVariations(config) {
|
||||||
const configError = {
|
const configError = {
|
||||||
...config,
|
...config,
|
||||||
rules: iterateRules(
|
rules: iterateRules(config.rules ?? {}, ([key, entry]) =>
|
||||||
config.rules ?? {},
|
(entry === 'off' || (Array.isArray(entry) && entry[0] === 'off')
|
||||||
([key, entry]) => [key, changeLevel(entry, 'error')],
|
? [key, entry]
|
||||||
|
: [key, changeLevel(entry, 'error')]),
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
const configWarning = {
|
const configWarning = {
|
||||||
...config,
|
...config,
|
||||||
rules: iterateRules(
|
rules: iterateRules(config.rules ?? {}, ([key, entry]) =>
|
||||||
config.rules ?? {},
|
(entry === 'off' || (Array.isArray(entry) && entry[0] === 'off')
|
||||||
([key, entry]) => [key, changeLevel(entry, 'warn')],
|
? [key, entry]
|
||||||
|
: [key, changeLevel(entry, 'warn')]),
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user