如何在代码中使用eslint-disable-next-line consistent-return来禁用下一行的consistent-return规则: 你只需在要禁用 consistent-return 规则的代码行的上方添加 // eslint-disable-next-line consistent-return 注释即可。这将告诉 ESLint 忽略下一行代码的 consistent-return 规则检查。 示例代码片段: javascript funct...
2 changes: 0 additions & 2 deletions 2 .eslintrc.js Original file line numberDiff line numberDiff line change @@ -78,7 +78,6 @@ module.exports = { 'space-infix-ops': 'error', 'space-in-parens': ['error', 'never'], 'keyword-spacing': 'error', 'consistent-return': 'error'...
"complexity": 0, //限制条件语句的复杂度 "consistent-return": 2, //无论有没有返回值都强制要求return语句返回一个值 "curly": ["error", "all"], //强制使用花括号的风格 "default-case": 0, //在switch语句中需要有default语句 "dot-notation": ["error", {"allowKeywords": false, "allowPatt...
[0, "never"],//是否允许计算后的键名什么的 "consistent-return": 0,//return 后面是否允许省略 "consistent-this": [2, "that"],//this别名 "constructor-super": 0,//非派生类不能调用super,派生类必须调用super "curly": [2, "all"],//必须使用 if(){} 中的{} "default-case": 2,//...
31 31 '@typescript-eslint/consistent-type-imports': 'error', 32 - '@typescript-eslint/explicit-function-return-type': 'error', 33 32 '@typescript-eslint/method-signature-style': 'error', 34 33 '@typescript-eslint/no-duplicate-type-constituents': 'error', 35 34 '@typescript-...
Wether this rule makes sense or not is a different question, but our rules are there for a reason so that our code has a consistent look and feel. We should never disable an eslint rule unless we are maybe in the middle of refactoring something or clearly have it identified with a TODO...
479 499 return { 480 500 filename: normalizeFilename(providedOptions.filename || ""), 481 501 allowInlineConfig: !ignoreInlineConfig, 482 502 warnInlineConfig: disableInlineConfig && !ignoreInlineConfig 483 503 ? `your config${configNameOfNoInlineConfig}` 484 504 : null, 485 - repo...