Eslint错误
npm run eject使配置文件暴露此时,产生了错误
Using babel-preset-react-app requires that you specify NODE_ENV or BABEL_ENV environment variables. Valid values are “development”, “test”, and “production”. Instead, received: undefined.
eslintrc.json
添加.eslintrc.json,推荐使用此方法对eslint进行详细配置
{
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"babelOptions": {
"presets": [
["babel-preset-react-app", false],
"babel-preset-react-app/prod"
]
}
}
}
Babel error immediately on eject https://github.com/facebook/create-react-app/issues/12070
parserOptions 解析器配置 & env 代码运行环境
https://blog.csdn.net/m0_52761633/article/details/123760575