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
  • Merge requests
  • !649

Remove eslintConfig from package.json

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/fson/remove-eslint-config into master Sep 14, 2016
  • Overview 3
  • Commits 1
  • Pipelines 0
  • Changes 2

Created by: fson

tl;dr The eslintConfig setting is used to make editor plugins such as linter use our ESLint configuration, but at the moment this requires additional packages and configuration to work, and we should not create the project with broken configuration. The configuration can still be added manually.

At the moment, when you create an app, the eslintConfig setting gets added to package.json. If you have an ESLint package (e.g. linter with linter-eslint) installed in your editor, you'll get a big error:

screen shot 2016-09-14 at 18 32 55 This error is shown every time you save a file, so you're forced to figure out what to do, even if you were just starting out and didn't want to configure the integrations yet.

After a little digging you'll find the instructions for installing the ESLint integration. We instruct the user to install ESLint and all the ESLint plugins globally and to configure the editor plugin to use the global ESLint. This is less than ideal for a few reasons:

  • The user now needs to track the ESLint plugins dependencies used by CRA and their versions manually and keep their global packages up-to-date.
  • You can't have different projects with different ESLint or ESLint plugin versions. Opening a file from a (non-CRA) project using an incompatible version now creates an error because your editor tries to use the globally installed ESLint and plugins: screen shot 2016-09-14 at 16 37 36

I've also seen people trying to edit the eslintConfig in package.json in order to use their own ESLint configuration, which doesn't work, which also makes having the configuration there misleading.

As we mention in the readme, having to rely on global ESlint will be fixed when ESlint is going to add support for having plugins as dependencies in packages like react-scripts, so we can enable the integration by default at that point. But until this has been fixed, it's better to not add this configuration by default. People can still find the instructions and add it manually when they want it and they're ready to do the plugin setup, but we should not create a configuration that doesn't work out of the box.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/fson/remove-eslint-config