Closed
Description
Describe the bug
Actually it re-opens #9047
I created .env file in root directory with EXTEND_ESLINT=true
then created .eslintrc.json file with my config for eslint
but while running npm start this config doesn't work!
Did you try recovering your dependencies?
(Write your answer here.)
Which terms did you search for in User Guide?
(Write your answer here if relevant.)
Environment
(paste the output of the command here.)
Steps to reproduce
- npx create-react-app my-app --template typescript
- add .env file in root directory with EXTEND_ESLINT=true
- add .eslint.json with some rules, for example "no-unused-vars": ["error"]
- Try to check if the rule is working. In App.tsx I added
const a= '';
Expected behavior
Expect it will consider rules from .eslintrc.json and fail to build app.
Actual behavior
Ignoring rules from .eslintrc.json
Activity
tobiaskraus commentedon Jun 22, 2020
I quote an answer from #9007 :
and if this is your problem, I hope that my proposal #9085 would be accepted, and someone could implement it.
poozhu commentedon Jun 23, 2020
I have test your example project, with the .eslintrc.json file, you can test the rule with another var name: c, it works well.
JRasmusBm commentedon Jul 8, 2020
Following the suggestion from @tobiaskraus I added the following line to the scripts section of our
package.json
. It should work wherever sed is available and perform the change suggested whenever the dependencies are installed.This resolved the issue such that our custom
eslint
config started working.lafe commentedon Jul 8, 2020
A cross-plattform solution might be to use the "patch-package" tool that can run as a postinstall-script and can patch files in node_modules. That's the approach we choose when we encountered this issue.
stale commentedon Aug 8, 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.
lafe commentedon Aug 10, 2020
From our point of view, the issue is still present.
croraf commentedon Aug 18, 2020
This should be closed in favor of #9085 @Barik85
feyzullahyildiz commentedon Sep 15, 2020
I think there is another env key is needed to disable cache besides
EXTEND_ESLINT
. This solution is working well but its not a good way and not documented on https://create-react-app.dev/docs/setting-up-your-editor/#experimental-extending-the-eslint-configstale commentedon Dec 25, 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.
lafe commentedon Dec 26, 2020
Will check on it in the new year...
3 remaining items