Steps to reproduce:
mkdir temp && cd temp && npm init -ynpm i -D xo typescriptCreate file a.ts:
export type T = {
[key: string]: number;
};
npx xo
@typescript-eslint/consistent-indexed-object-style is reported as expectedDisable the rule from an overrides option in package.json:
{
"xo": {
"rules": {
"no-await-in-loop": "off"
},
"overrides": {
"files": "**/*.ts",
"rules": {
"@typescript-eslint/consistent-indexed-object-style": "off"
}
}
}
}
npx xo
@typescript-eslint/consistent-indexed-object-style is still reported.As a sanity check move the "@typescript-eslint/consistent-indexed-object-style": "off" setting outside the "overrides" option:
{
"xo": {
"rules": {
"no-await-in-loop": "off",
"@typescript-eslint/consistent-indexed-object-style": "off"
}
}
}
... Now it works as is should... But why doesn't it work within the "overrides" option?
overrides accepts an array of objects, not just an object.
We should definitely have better validation for this though and throw an error on an incorrect type. PR welcome for that.
Most helpful comment
overridesaccepts an array of objects, not just an object.We should definitely have better validation for this though and throw an error on an incorrect type. PR welcome for that.