在我的 ESLint 配置文件 ( eslintrc.json) 中,我有以下规则:
// ...
"no-underscore-dangle": [
"error",
{
"enforceInMethodNames": true,
"allowFunctionParams": false
}
],
// ...
Run Code Online (Sandbox Code Playgroud)
与文档似乎建议的相反,它会导致以下错误:
Error: .eslintrc.json:
Configuration for rule "no-underscore-dangle" is invalid:
Value {"enforceInMethodNames":true,"allowFunctionParams":false,"allowAfterThis":false,"allowAfterSuper":false,"allowAfterThisConstructor":false} should NOT have additional properties.
Run Code Online (Sandbox Code Playgroud)
如果我从其选项中删除该规则,我不会收到任何错误:"no-underscore-dangle": "error"。我更愿意使用这两个选项。我缺少什么?有任何想法吗?
ESLint 版本:7.6.0
节点版本:12.17.0
eslint ×1