"no-nested-ternary": 0,//禁止使用嵌套的三目运算 "no-new": 1,//禁止在使用new构造一个实例后不赋值 "no-new-func": 1,//禁止使用new Function "no-new-object": 2,//禁止使用new Object() "no-new-require": 2,//禁止使用new require "no-new-wrappers": 2,//禁止使用new创建包装实例,new...
“no-negated-in-lhs”: 2,//in 操作符的左边不能有! “no-nested-ternary”: 0,//禁止使用嵌套的三目运算 “no-new”: 1,//禁止在使用new构造一个实例后不赋值 “no-new-func”: 1,//禁止使用new Function “no-new-object”: 2,//禁止使用new Object() “no-new-require”: 2,//禁止使用n...
/*eslint no-unneeded-ternary: "error"*/vara=x===2?"Yes":"No";vara=x!==false;vara=x?"Yes":"No";vara=x?y:x;vara=x?x:1;// Note that this is only allowed as it on the right hand side of an assignment; this type of ternary is disallowed everywhere else. See defaultAssignment...
"no-negated-in-lhs": 2,//in 操作符的左边不能有! "no-nested-ternary": 0,//禁止使用嵌套的三目运算 "no-new": 1,//禁止在使用new构造一个实例后不赋值 "no-new-func": 1,//禁止使用new Function "no-new-object": 2,//禁止使用new Object() "no-new-require": 2,//禁止使用new require...
"no-nested-ternary": 0,//禁止使用嵌套的三目运算 "no-new": 1,//禁止在使用new构造一个实例后不赋值 "no-new-func": 1,//禁止使用new Function "no-new-object": 2,//禁止使用new Object() "no-new-require": 2,//禁止使用new require "no-new-wrappers": 2,//禁止使用new创建包装实例,new...
no-nested-ternary 禁止嵌套三元表达式 嵌套三元表达式会使代码更难理解。 varfoo=bar?baz:qux===quxx?bing:bam; #规则详情 no-nested-ternary规则不允许嵌套三元表达式。 此规则的错误代码示例:
"no-multi-spaces": 1,//不能用多余的空格 "no-multi-str": 2,//字符串不能用\换行 "no-multiple-empty-lines": [1, {"max": 2}],//空行最多不能超过2行 "no-native-reassign": 2,//不能重写native对象 "no-negated-in-lhs": 2,//in 操作符的左边不能有! "no-nested-ternary": 0,/...
assignno-multi-strno-negated-conditionno-nested-ternaryno-newno-new-funcno-new-native-nonconstructorno-new-symbolno-new-wrappersno-nonoctal-decimal-escapeno-obj-callsno-object-constructorno-octalno-octal-escapeno-param-reassignno-plusplusno-promise-executor-returnno-protono-prototype-builtinsno-...
/*eslint no-nested-ternary: "error"*/varthing=foo?bar:baz===qux?quxx:foobar;foo?baz===qux?quxx():foobar():bar(); Examples ofcorrectcode for this rule: /*eslint no-nested-ternary: "error"*/varthing=foo?bar:foobar;varthing;if(foo){thing=bar;}elseif(baz===qux){thing=quxx;}...
"no-negated-in-lhs": 2,//in 操作符的左边不能有! "no-nested-ternary": 0,//禁止使用嵌套的三目运算 "no-new": 1,//禁止在使用new构造一个实例后不赋值 "no-new-func": 1,//禁止使用new Function "no-new-object": 2,//禁止使用new Object() "no-new-require": 2,//禁止使用new require...