Commit af274e95 by damodmg

修改eslint复杂度

parent c7755430
// https://eslint.org/docs/user-guide/configuring // https://eslint.org/docs/user-guide/configuring
module.exports = { module.exports = {
root: true, root: true,
parserOptions: { parserOptions: {
...@@ -52,7 +53,7 @@ module.exports = { ...@@ -52,7 +53,7 @@ module.exports = {
'no-empty': [ 'no-empty': [
2, 2,
{ {
"allowEmptyCatch": true allowEmptyCatch: true
} }
], ],
// 禁止将 catch 的第一个参数 error 重新赋值 【重新赋值,error将没有意义】 // 禁止将 catch 的第一个参数 error 重新赋值 【重新赋值,error将没有意义】
...@@ -84,9 +85,9 @@ module.exports = { ...@@ -84,9 +85,9 @@ module.exports = {
*/ */
// 禁止函数的循环复杂度超过 20,【https://en.wikipedia.org/wiki/Cyclomatic_complexity】 // 禁止函数的循环复杂度超过 20,【https://en.wikipedia.org/wiki/Cyclomatic_complexity】
complexity: [ complexity: [
2, 0,
{ {
"max": 20 max: 20
} }
], ],
// 不允许有空函数,除非是将一个空函数设置为某个项的默认值 【否则空函数并没有实际意义】 // 不允许有空函数,除非是将一个空函数设置为某个项的默认值 【否则空函数并没有实际意义】
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment