Closed Emmahchinonso closed 1 year ago
Did you add "lint": "eslint .", "lint:fix": "eslint . --fix"
to the scripts section of your package.json?
I can confirm I'm having the same issue. Seems like eslint
isn't able to find the .eslintrc
file in the project root for whatever reason.
It might be that the react-app/jest
config - try take it out and try again.
Also make sure you are running this in the root directory. sometimes if the parent has any eslint configs things get weird.
If you can post a reproduction, Ill take a lookski
Thanks @wesbos, that did it! Removing react-app/jest
from eslintConfig
in my create-react-app project fixed it.
So now it looks like this:
"eslintConfig": { "extends": [ "react-app", "wesbos" ] },
awesome - I was going to suggest that - put the other things first - mine will overwrite any duplicate properties
closing this but let me know if you still have troubles
Hello, please can anyone help. I first created a create-react-app project, then decided to add typescript later on. I followed the instructions in the readme but when I try to run
npm run lint
it just freezes, it doesn't do anything, no errors and I have just two files. I don't know what I did wrong."devDependencies": { "@babel/core": "^7.17.9", "@babel/eslint-parser": "^7.17.0", "@babel/preset-react": "^7.16.7", "@types/node": "^16.11.27", "@typescript-eslint/eslint-plugin": "^5.18.0", "@typescript-eslint/parser": "^5.18.0", "eslint": "^8.13.0", "eslint-config-airbnb": "^19.0.4", "eslint-config-airbnb-typescript": "^16.2.0", "eslint-config-prettier": "^8.5.0", "eslint-config-wesbos": "^3.0.2", "eslint-plugin-html": "^6.2.0", "eslint-plugin-import": "^2.26.0", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-react": "^7.29.4", "eslint-plugin-react-hooks": "^4.4.0", "husky": "^7.0.0", "lint-staged": "^12.4.0", "prettier": "^2.6.2", "typescript": "^4.6.3" }
.eslintrc
{ "extends": ["wesbos/typescript", "react-app/jest"] }tsconfig.json
{ "compilerOptions": { "jsx": "react", "target": "es2016" / Set the JavaScript language version for emitted JavaScript and include compatible library declarations. /, "module": "commonjs" / Specify what module code is generated. /, "strict": true / Enable all strict type-checking options. /, "skipLibCheck": true / Skip type checking all .d.ts files. / } }