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

only load eslint config when EXTEND_ESLINT environment variable is specified/ do not swallow eslint config errors

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/n1ru4l/patch-1 into master Aug 14, 2019
  • Overview 6
  • Commits 2
  • Pipelines 0
  • Changes 1

Created by: n1ru4l

Based on the following discussion that got no response:

https://github.com/facebook/create-react-app/pull/7513#pullrequestreview-274168733 https://github.com/facebook/create-react-app/pull/7513#issuecomment-520872886 https://github.com/facebook/create-react-app/issues/7510#issuecomment-520336416

Summary:

Swallowing the eslint config error is not a good idea

The line eslintConfig = eslintCli.getConfigForFile(paths.appIndexJs); can throw in case the provided eslint config is invalid, e.g. when there is a typo or a plugin dependency is missing. Swallowing that error in case the user explicitly sets the EXTEND_ESLINT environment variable (and therefore expects that his eslint config is used) makes debugging such issues unnecessary cumbersome.

The eslint config should only be loaded in case the user wants to load it

The eslint config is never used in case the EXTEND_ESLINT is not set. Therefore it makes sense to only resolve it's path in case the environment variable is set.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/n1ru4l/patch-1