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
  • #7776
Closed
Open
Issue created Oct 03, 2019 by Administrator@rootContributor

Extending ESLint is not supporting overrides

Created by: Andarist

Extending ESLint got introduced originally in https://github.com/facebook/create-react-app/pull/7036 by @mrmckeb. It's stated that this is limited currently to users configuring their ESLint in package.json:

  • this ain't quite true - because used eslintCli.getConfigForFile is not limited to package.json configs
  • there is no such mention in the docs - not a biggie but brought a little bit of confusion for me.

What is actually stated in the docs and what doesn't actually hold true is that overrides can be used to support TS rules etc (there is example of that).

This is not quite true, because whatever config gets loaded & resolved through that eslintCli.getConfigForFile call (with paths.appIndexJs as argument) gets set as "global" config for the whole eslint-loader.

So depending on what paths.appIndexJs is we either can get:

  • all TS-related rules being applied to ALL files (including JS) - when paths.appIndexJs is TS
  • no TS rules are applied at all - when paths.appIndexJs is JS

For this to work correctly it would be the easiest to allow ESLint to load configs on its own - without passing explicit single config to the eslint-loader.

Assignee
Assign to
Time tracking