eslint私人规范

it2025-08-07  12

eslint私人规范

rules:{ "no-duplicate-case": 2,//switch中的case标签不能重复 "no-eq-null": 2,//禁止对null使用==或!=运算符 "no-func-assign": 2,//禁止重复的函数声明 "no-mixed-spaces-and-tabs": [2, false],//禁止混用tab和空格 "no-nested-ternary": 0,//禁止使用嵌套的三目运算 "no-redeclare": 2,//禁止重复声明变量 "no-unreachable": 2,//不能有无法执行的代码 "no-unused-expressions": 2,//禁止无用的表达式 "no-use-before-define": 2,//未定义前不能使用 "camelcase": 2,//强制驼峰法命名 "complexity": [0, 5],//循环复杂度 "indent": [2, 4],//缩进风格 "max-depth": [0, 4],//嵌套块深度 "keyword-spacing":["error",{"before": true, "after": true}]   //关键字前后必须有空格 如 } else { }
最新回复(0)