简体   繁体   English

eslint中的jscs`disallowKeywordsOnNewLine`等效于什么?

[英]what's the equivalent of jscs `disallowKeywordsOnNewLine` in eslint?

what's the equivalent of jscs 's disallowKeywordsOnNewLine in eslint ? jscsdisallowKeywordsOnNewLine等效于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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM