+ 2
Parsing error: No Babel config file detected for \src\App.js. Either disable config file checking with requireConfigFile: false,
To fix this we need to modify parserOptions: parserOptions: { requireConfigFile: false, }, Can someone tell me where this code is to be added? In .eslintrc or package.json? .. Because in both of these files there's no such field.
1 Odpowiedź
+ 2
Anyone having the same issue as above, follow along the instructions given on this site: https://tjaddison.com/blog/2021/03/updating-babel-eslint-to-babeleslint-parser-for-react-apps/
> Remove babel-eslint
> Add @babel/eslint-parser @babel/preset-react
You may also need the peer dependency @babel/core (npm7 installs peer dependencies by default)
> Update the parser in your .eslintrc.* file (from babel-eslint to @babel/eslint-parser)
>Add the following to the parserOptions configuration in your .eslintrc.* file:
requireConfigFile: false,
babelOptions: {
presets: ["@babel/preset-react"]
}
This solution worked for me, hope it helps you too!