Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eslint-config-react-app fails with ESLint v6 #7218

Closed
ivan-aksamentov opened this issue Jun 14, 2019 · 0 comments · Fixed by #7219
Closed

eslint-config-react-app fails with ESLint v6 #7218

ivan-aksamentov opened this issue Jun 14, 2019 · 0 comments · Fixed by #7219

Comments

@ivan-aksamentov
Copy link
Contributor

ivan-aksamentov commented Jun 14, 2019

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:)

  1. In a project that uses eslint-config-react-app, upgrade eslint to version 6 (e.g. 6.0.0-rc.0)
  2. Run eslint
  3. 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 .
@ivan-aksamentov ivan-aksamentov changed the title eslint-config-react-app fails with ESLint v6 eslint-config-react-app fails with ESLint v6 Jun 14, 2019
@lock lock bot locked and limited conversation to collaborators Jun 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant