添加
"@typescript-eslint/strict-boolean-expressions": [
2,
{
"ignoreRhs": true,
"allow-boolean-or-undefined": true
}
],
"@typescript-eslint/strict-boolean-expressions“:规则eslintrc.json的配置无效:.eslintrc.json {"ignoreRhs":true,"allow-boolean-or-undefined":true}不应该有其他属性。
提到此规则的选项的正确方式是什么?
发布于 2020-11-01 17:35:59
在eslintrc rules上,你可以尝试下面的配置,eslint会停止通知你。
"rules": {
"@typescript-eslint/strict-boolean-expressions": 0
}
发布于 2020-04-08 15:15:10
对于ESLint上的此规则,不存在允许布尔值或未定义值,等效的选项是allowNullable。正确的语法是:
'@typescript-eslint/strict-boolean-expressions': ['error', { allowNullable: true, ignoreRhs: true }],
您可以在文档中查看规则strict-boolean-expressions documentation
https://stackoverflow.com/questions/59670957
复制