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
  • !993

Move ESLint configuration to an ESLint plugin

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/fson/eslint-plugin into master Oct 31, 2016
  • Overview 8
  • Commits 1
  • Pipelines 0
  • Changes 7

Created by: fson

Work in progress, not ready for merging before the issues have been fixed and we've decided if we want this change.

Not being able to depend on ESLint plugins in our shareable config has been a long-standing issue (#173 (closed), #649, #866 (closed)).

Adding support for this in ESLint is being discussed in eslint/eslint#3458. In https://github.com/eslint/eslint/issues/3458#issuecomment-257161846, @nzakas suggested that the problem of bundling plugins as dependencies could be solved using an ESLint plugin instead of a shareable config. This PR is a first attempt to implement Create React App ESLint configuration as a plugin.

Breaking changes if we implement this change (for projects using eslint-config-react-app directly, e.g. ejected projects):

  • users of eslint-config-react-app will have to switch the dependency to eslint-plugin-react-app and replace "extends": "react-app" with"extends": "plugin:react-app/recommended"`
  • users of eslint-config-react-app should remove import, flowtype, jsx-a11y and react plugin dependencies because we will bundle them in our plugin
  • users of eslint-config-react-app that have extended the configuration will have to prefix plugin specific rules, e.g. "react/no-is-mounted": "error" becomes "react-app/react/no-is-mounted": "error"

Remaining issues:

  • Currently getting an error when trying to start the app: Error: Failed to load plugin react-app: Cannot find module 'eslint-plugin-react-app' Referenced from: /Users/ville/Projects/create-react-app/my-es-app/node_modules/react-scripts/.eslintrc, so I'm not sure if ESLint will be able to resolve the plugin correctly (especially if it's been bundled inside react-scripts).
  • Editor integrations need to be tested and documentation changed.
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/fson/eslint-plugin