Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #7510
Closed
Open
Issue created Aug 11, 2019 by Administrator@rootContributor

Extending ESLint config not working

Created by: conor-cafferkey-sociomantic

Describe the bug

Extending ESLint config not working.

Environment

  System:
    OS: macOS 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
  Binaries:
    Node: 8.15.0 - ~/.nvm/versions/node/v8.15.0/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.4.1 - ~/.nvm/versions/node/v8.15.0/bin/npm
  Browsers:
    Chrome: 76.0.3809.100
    Firefox: 67.0
    Safari: 12.1.2
  npmPackages:
    react: ^16.9.0 => 16.9.0
    react-dom: ^16.9.0 => 16.9.0
    react-scripts: 3.1.0 => 3.1.0
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. yarn create react-app testapp (or npx create-react-app testapp)
  2. cd testapp
  3. yarn add eslint-config-airbnb (or npm install eslint-config-airbnb)
  4. Add the following to package.json:
"eslintConfig": { "extends": [ "react-app", "airbnb"] } 
  1. EXTEND_ESLINT=true yarn start ( or EXTEND_ESLINT=true npm start)

Expected behavior

  • eslint-config-airbnb should be used
  • app should not compile

Actual behavior

  • eslint-config-airbnb is not used
  • app compiles (it shouldn’t!)

Problem

webpack.config.js checks thateslintConfig.extends exists: https://github.com/facebook/create-react-app/blob/c0b4173d1bba37fde2d699fe9914d16f823bcbe5/packages/react-scripts/config/webpack.config.js#L355 and – if it does – that it includes 'react-app': https://github.com/facebook/create-react-app/blob/c0b4173d1bba37fde2d699fe9914d16f823bcbe5/packages/react-scripts/config/webpack.config.js#L356

It seems that the property extends never exists on eslintConfig(??)

Deleting the above two lines yields the expected behavior (eslint-config-airbnb is picked up and we see lint errors / Failed to compile message)

Assignee
Assign to
Time tracking