Skip to content

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

Closed
@ivan-aksamentov

Description

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

  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 .

Activity

changed the title [-]`eslint-config-react-app` fails with ESLint v6[/-] [+]eslint-config-react-app fails with ESLint v6[/+] on Jun 14, 2019
locked and limited conversation to collaborators on Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @ivan-aksamentov

      Issue actions

        eslint-config-react-app fails with ESLint v6 · Issue #7218 · facebook/create-react-app