【发布时间】:2020-08-26 18:18:52
【问题描述】:
收到此错误
./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
}
}
这些都不起作用。
【问题讨论】:
-
"no-template-curly-in-string": "off",应该可以工作,您确定正在加载配置文件吗?如果您将其命名为.eslintrc.jsonper the docs,会怎样? -
我正在使用 create-react-app,老实说,我不确定 eslintrc 文件是否正在加载。尝试使用
.eslintrc.json但仍然无法正常工作。 -
更多上下文:stackoverflow.com/questions/60290876/… 我认为更多是 CRA 的问题而不是 ESLint。谢谢你们的cmets。
标签: eslint