eslint - 值...不应该有额外的属性
问题描述
在我的 ESLint 配置文件 ( eslintrc.json
) 中,我有以下规则:
// ...
"no-underscore-dangle": [
"error",
{
"enforceInMethodNames": true,
"allowFunctionParams": false
}
],
// ...
与文档似乎建议的相反,它会导致以下错误:
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.
如果我从其选项中删除规则,我不会收到任何错误:"no-underscore-dangle": "error"
. 我更喜欢使用这两个选项。我错过了什么?有任何想法吗?
ESLint 版本:7.6.0
节点版本:12.17.0
解决方案
我将 ESLint 更新为 7.10.0,现在错误消失了:
npm i -D eslint
推荐阅读
- python - 基于彼此设置自变量
- python - 不能pickle在linode上加载对象
- javascript - 带有换行符和 Unicode 字符的 Javascript 发布表单
- c - C - Linux 模块:关键部分内的 wait_event_interruptible
- ssrs-2012 - SSRS 报告 - PDF/Word 导出性能
- c++ - 使用 std::unique_ptr 有什么好处吗?
- ml.net - 如何在 ML.NET 中向 IDataView 添加多个自定义列
- android - Android上的灰度二值图像分割
- postgresql - timescaledb postgresql 性能问题
- html - Django POST 表单被除 1 按钮之外的所有人接受。潜在的错误?