getting rule not found with react build
See original GitHub issueDescribe the bug
yarn build (react-scripts build) is failing with several rules not being found while yarn lint (eslint .) doesn’t fail. I assume that react forces @typescript-eslint version and version installed in my package.json doesn’t work there.
Did you try recovering your dependencies?
I’ve tried reinstalling but didn’t help.
Which terms did you search for in User Guide?
eslint
Environment
I’ve tried on but ubuntu and mac.
Steps to reproduce
- install @typescript-eslint/eslint-plugin (^4.6.1)
- add @typescript-eslint/no-unnecessary-type-constraint to eslint configs
- run build
Expected behavior
I expect react to use my installed eslint plugin and not one installed in react-scripts.
(Write what you thought would happen.)
Actual behavior
the @typescript-eslint/eslint-plugin installed in react-scripts is used
(Write what happened. Please add screenshots!)
Reproducible demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
My create-react-app is failing to compile due to ESLint error
1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder. · 2. Delete node_modules in your project folder. · 3.
Read more >How To Customize ESLint Rules with an Ejected Create React ...
In ESLint not only can you completely customize a single rule, but you can disable an entire file, a line, or even just...
Read more >Reconciliation - React
When building up a new tree, new DOM nodes are inserted into the DOM. Component instances receive UNSAFE_componentWillMount() and then componentDidMount() . Any ......
Read more >404: React Page Not Found - Karen Ying
Netlify's 404 Page. You just deployed your first Create React App to Netlify. Site is live shows up in the scrolling deployment log....
Read more >How to add a custom ESLint configuration to a Create React ...
To checkout the rules and plugins used in react-app ESLint config, ... husky will complain about lint-staged command being missing.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you upgraded from
3.x.x
to4.x.x
, issues with missing rules are caused by lack ofeslintConfig
section inpackage.json
Without that section: eslint rules are not extended by those from
eslint-config-react-app
, includingreact-hooks/exhaustive-deps
Maybe it should be included in migration guide?
Encountering this issue only in yarn build but not when running eslint:
Definition for rule '@typescript-eslint/no-shadow' was not found @typescript-eslint/no-shadow
Working around this by passing
DISABLE_ESLINT_PLUGIN=true