获取此错误
./src/locale/translations.js
Line 4:5: Unexpected template string expression no-template-curly-in-string
Line 6:13: Unexpected template string expression no-template-curly-in-string并尝试禁用整个项目:
// .eslintrc
{
"rules": {
"no-template-curly-in-string": "off",
"template-curly-in-string": "off"
// "no-template-curly-in-string": 0,
// "template-curly-in-string": 0
// "no-template-curly-in-string": false,
// "template-curly-in-string": false
}
}这些都不管用。
发布于 2020-10-25 19:06:54
尝试更新为react-scripts@4.0.0,因为我在以前的版本3.X.X中发现了一个issue,其中忽略了eslint。
更新:
npm install --save --save-exact react-scripts@4.0.0或
yarn add --exact react-scripts@4.0.0这在我的情况下是可行的;)
发布于 2021-08-27 19:37:32
我可以使用以下命令禁用它:
// package.json
"eslintConfig": {
"extends": "react-app",
"rules": {
"no-template-curly-in-string": "off"
}诀窍是在更新package.json之后将EXTEND_ESLINT=true添加到我的环境文件中,然后重启我的服务器。
https://stackoverflow.com/questions/61725789
复制相似问题