I keep getting the following error when I try to enable @babel/plugin-proposal-class-properties
in my .babelrc
and @babel/eslint-parser
in my .eslintrc.json
.
Parsing error: No Babel config file detected for .../React-intro/src/Details.jsx. Either disable config file checking with requireConfigFile: false, or configure Babel so that it can find the config files.eslint.
I've tried adding requireConfigFile: false
to my eslintrc.json
but then eslint can't find my .babelrc
. Both files are in the root directory of my project. Cant figure out what im doing wrong. I've confirmed that my .eslintrc.json
, .babelrc
, and package.json
are identical to the ones in 09-managing-state-in-class-components. I'm just going to ignore the error to get through the course as everything still works, but any help on what I might be doing wrong would be greatly appreciated.
My .eslintrc.json
:
{
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:react/recommended",
"plugin:jsx-a11y/recommended",
"plugin:react-hooks/recommended",
"prettier"
],
"rules": {
"react/prop-types": 0,
"react/react-in-jsx-scope": 0
},
"parser": "@babel/eslint-parser",
"plugins": [
"react",
"import",
"jsx-a11y"
],
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"browser": true,
"es6": true,
"node": true
},
"settings": {
"react": {
"version": "detect"
}
}
}
My .babelrc
:
{
"presets": [
[
"@babel/preset-react",
{
"runtime": "automatic"
}
],
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
My package.json
:
{
"name": "adopt-me",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"dev": "parcel src/index.html",
"build": "parcel build src/index.html",
"format": "prettier --write \"src/**/*.{js,jsx}\"",
"lint": "eslint \"src/**/*.{js,jsx}\" --quiet"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/core": "7.12.16",
"@babel/eslint-parser": "7.13.4",
"@babel/plugin-proposal-class-properties": "7.13.0",
"@babel/preset-env": "7.13.5",
"@babel/preset-react": "7.12.13",
"eslint": "7.18.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-react": "7.22.0",
"eslint-plugin-react-hooks": "4.2.0",
"parcel": "1.12.3",
"prettier": "2.2.1"
},
"dependencies": {
"react": "17.0.1",
"react-dom": "17.0.1",
"react-router-dom": "5.2.0"
},
"browserslist": [
"last 2 Chrome versions"
]
}