[英]what's the equivalent of jscs `disallowKeywordsOnNewLine` in eslint?
what's the equivalent of jscs
's disallowKeywordsOnNewLine
in eslint
? jscs
的disallowKeywordsOnNewLine
等效于eslint
? I can't find it in the docs :( 我在文档中找不到它:(
disallowKeywordsOnNewLine Disallows placing keywords on a new line. disallowKeywordsOnNewLine不允许在新行上放置关键字。
Type: Array 类型:数组
Values: Array of quoted keywords 值:带引号的关键字数组
Example 例
"disallowKeywordsOnNewLine": ["else"]
Valid 有效
if (x < 0) {
x++;
} else {
x--;
}
Invalid 无效
if (x < 0) {
x++;
}
else {
x--;
}
Maybe this option is not available in eslint
? 也许这个选项在
eslint
不可用?
What your looking for is brace-style
in eslint
. 您想要的是
eslint
brace-style
。 Link: http://eslint.org/docs/rules/brace-style 链接: http : //eslint.org/docs/rules/brace-style
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.