Created by: ivan-aksamentov
Attempts to fix #7218 (closed)
Array format for overrides
key in eslint config file is now enforced to be an array in ESLint v6. Anyone who uses eslint-config-react-app
and ESLint v6 gets a type mismatch error:
Error: ESLint configuration in .eslintrc.js » eslint-config-react-app is invalid:
- Property "overrides" is the wrong type (expected array but got `{"files":["**/*.ts","**/*.tsx"],"parser":"@typescript-eslint/parser","parserOptions":{"ecmaVersion":2018,"sourceType":"module","ecmaFeatures":{"jsx":true},"warnOnUnsupportedTypeScriptVersion":true},"plugins":["@typescript-eslint"],"rules":{"default-case":"off","no-dupe-class-members":"off","@typescript-eslint/no-angle-bracket-type-assertion":"warn","no-array-constructor":"off","@typescript-eslint/no-array-constructor":"warn","@typescript-eslint/no-namespace":"error","no-unused-vars":"off","@typescript-eslint/no-unused-vars":["warn",{"args":"none","ignoreRestSiblings":true}],"no-useless-constructor":"off","@typescript-eslint/no-useless-constructor":"warn"}}`).
This commit fixes the error by converting the object into a one-element array containing that object. Only 3 characters are added: [
, ]
and ,
. The large diff is due to formatting.