不使用嵌套的三元表达式 'no-spaced-func': 2, // 函数调用时 函数名与()之间不能有空格 'no-trailing-spaces': 2, // 一行结束后面不要有空格 'no-unneeded-ternary
2,//不能使用undefined "no-unexpected-multiline": 2,//避免多行表达式 "no-underscore-dangle": 1,//标识符不能以_开头或结尾 "no-unneeded-ternary
'error', // 不允许在case/default子句中使用词法声明 'no-nested-ternary': 'error', // 三元表达式不应该嵌套,通常是单行表达式 'no-unneeded-ternary
2,//不能使用undefined “no-unexpected-multiline”: 2,//避免多行表达式 “no-underscore-dangle”: 1,//标识符不能以_开头或结尾 “no-unneeded-ternary
eslint: no-unneeded-ternary / bad const foo = a ? a : b; const bar = c ?
eslint: no-unneeded-ternary let score = val ?
禁止直接调用 Object.prototypes 的内置属性 'no-prototype-builtins': 0, // 禁止可以在有更简单的可替代的表达式时使用三元操作符 'no-unneeded-ternary
2,//不能使用undefined "no-unexpected-multiline": 2,//避免多行表达式 "no-underscore-dangle": 1,//标识符不能以_开头或结尾 "no-unneeded-ternary...* @category Stylistic Issues * @reason 后者表达的更清晰 * @fixable */ 'no-unneeded-ternary
领取专属 10元无门槛券
手把手带您无忧上云