question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-scripts build ignores ESLint overrides

See original GitHub issue

Bringing back #8266 as something that I’m experiencing now.

Describe the bug

I made a lint rule that applies everywhere but want to exclude it for a directory. ESLint supports the overrides option to achieve this but react-scripts build ignores that and applies the rule anyway with EXTEND_ESLINT=true option

Did you try recovering your dependencies?

irrelevant

Which terms did you search for in User Guide?

extend eslint overrides lint

Environment

Environment Info:

  System:
    OS: macOS 10.15.3
    CPU: (4) x64 Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
  Binaries:
    Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
  Browsers:
    Chrome: 80.0.3987.149
    Firefox: 74.0
    Safari: 13.0.5
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found

Steps to reproduce

  1. Make a CRA app
  2. add EXTEND_ESLINT=true to your invocation of react-scripts
  3. Make an ESLint file with a rule, and an override for that rule in with the overrides property
  4. Make a file that breaks the rule but should be overridden
  5. run react-scripts dev or react-scripts build and see that CRA complains anyway

Expected behavior

It respects the rule

Actual behavior

It doesn’t

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:32
  • Comments:22

github_iconTop GitHub Comments

35reactions
stale[bot]commented, May 6, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

19reactions
cain-wangcommented, Sep 23, 2020

It’s been half a year. Hope this will be prioritized soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable ESLint that create-react-app provides - Stack Overflow
As of react-scripts v4.0.2, you can now opt out of ESLint with an environment variable. You can do this by adding it to...
Read more >
How to add a custom ESLint configuration to a Create React ...
Create a .eslintignore file to ignore certain files/folders from linting. You can ignore the node_modules, distribution folders, cache folders ...
Read more >
Ignoring Code - ESLint - Pluggable JavaScript Linter
You cannot write ignorePatterns property under overrides property. Patterns defined in .eslintignore take precedence over the ignorePatterns property of ...
Read more >
eslint-plugin-disable - npm
To disable all plugins except specified ones use "disableAllExcept" flag in config settings (.eslintrc). The following config will disable all ...
Read more >
[Solved]-Disable ESLint that create-react-app provides-Reactjs
note that override > rules section: add rules with "off" flag to disable them. ... You can disable eslint (and override other configurations)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found