eslintcomplexity:["error",2]*/functiona(x){if(true){returnx;}else{return4;}} 选项 或者,您可以指定一个max对象属性: "complexity
Complexity Amortizedconstant.
Exceptions [表格] Complexity Constant.
trueifthecontentsofthecontainersareequal,falseotherwise 2)trueifthecontentsofthecontainersarenotequal,falseotherwise Complexity
eslint-enves6*/functionfoo(bar,baz,qux){doSomething();}letfoo=(bar,baz,qux)=>{doSomething();};RelatedRules complexity
varfoo3=3;varfoo4=4;varfoo5=5;varfoo6=6;varfoo7=7;varfoo8=8;varfoo9=9;varfoo10=10;varfoo11=11;} 相关规则 complexity
vardep=require('really/really/really/really/really/really/really/really/long/module'); RelatedRules complexity
可以使用以下方法: {"extends":"eslint:recommended","rules":{"no-unsafe-finally":"off","no-native-reassign":"off","complexity
unspecified*/;staticconstexprerror_typeerror_badrepeat=/*unspecified*/;staticconstexprerror_typeerror_complexity
Complexity:O(n).