I had a strange issue with eslint before and I had to uninstall node_modules and do npm install and since I did that I have been getting new errors I've never had before within my code. One error that I can't quite figure out how to fix is this.
ERROR in [eslint] Failed to load config "react-app" to extend from.
Referenced from: C:\Users\Justi\Downloads\package.json
Here's my package.json folder:
{
"name": "gingerrmarket",
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/react-fontawesome": "^0.1.16",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@mui/icons-material": "^5.0.4",
"@mui/material": "^5.1.0",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^11.2.7",
"@testing-library/user-event": "^12.8.3",
"firebase": "^9.4.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-feather": "^2.0.9",
"react-router-dom": "^6.0.0",
"react-scripts": "^5.0.1",
"web-vitals": "^1.1.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
And here's my eslint parser file in babel (I'm not sure if it'll be any use.)
"name": "@babel/eslint-parser",
"version": "7.18.2",
"description": "ESLint parser that allows for linting of experimental syntax transformed by Babel",
"author": "The Babel Team (https://babel.dev/team)",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "eslint/babel-eslint-parser"
},
"publishConfig": {
"access": "public"
},
"bugs": {
"url": "https://github.com/babel/babel/issues"
},
"homepage": "https://babel.dev/",
"engines": {
"node": "^10.13.0 || ^12.13.0 || >=14.0.0"
},
"main": "./lib/index.cjs",
"type": "commonjs",
"exports": {
".": "./lib/index.cjs",
"./experimental-worker": "./lib/experimental-worker.cjs",
"./package.json": "./package.json"
},
"peerDependencies": {
"@babel/core": ">=7.11.0",
"eslint": "^7.5.0 || ^8.0.0"
},
"dependencies": {
"eslint-scope": "^5.1.1",
"eslint-visitor-keys": "^2.1.0",
"semver": "^6.3.0"
},
"devDependencies": {
"@babel/core": "^7.18.2",
"dedent": "^0.7.0",
"eslint": "^7.27.0",
"eslint-8": "npm:eslint@^8.0.0"
}
}
Does anyone have any suggestions? Please help.
CodePudding user response:
Have you tried running npm i eslint-config-react-app -D
yet?
CodePudding user response:
For this all that was needed was
"eslintConfig": { "extends": [ "react-app", "react-app/jest" ] },
In package.json