eslint-config-react-app fails with ESLint v6
Created by: ivan-aksamentov
TLDR:
overrides
option in eslint-config-react-app
has incorrect type (object, not array). Eslint v6 (it implements stricter config type checks) now fails in any project that uses eslint-config-react-app
.
PR #7219
Please note that this issue affects users beyond create-react-app
, because many projects use eslint-config-react-app
as a starting points for their eslint configurations. These users are unable to try Eslint 6 until this is sorted out.
Is this a bug report?
yes
Did you try recovering your dependencies?
yes
Which terms did you search for in User Guide?
none
Environment
Environment Info:
System:
OS: Linux 4.18 Ubuntu 18.04.2 LTS (Bionic Beaver)
CPU: Not Found
Binaries:
Node: 12.4.0 - ~/.nvm/versions/node/default/bin/node
Yarn: 1.16.0 - ~/.nvm/versions/node/default/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/default/bin/npm
Browsers:
Chrome: Not Found
Firefox: Not Found
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found
Steps to Reproduce
(Write your steps here:)
- In a project that uses
eslint-config-react-app
, upgradeeslint
to version 6 (e.g.6.0.0-rc.0
) - Run eslint
- Receive an error
Expected Behavior
No errors
Actual Behavior
eslint fails with an 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"}}`).
Reproducible Demo
git clone https://github.com/facebook/create-react-app
cd create-react-app
yarn install
npx ncu --upgrade --newest eslint
yarn install
eslint .