简体   繁体   English

从JSCS到ESLint:缺少规则

[英]Coming from JSCS to ESLint: missing rules

We have decided to switch over from JSCS to ESLint as it allows more checks for other things. 我们已决定从JSCS切换到ESLint,因为它可以进行其他检查。 I've managed to convert most of the rules, but two of them I am unable to match with ESLint ruleset. 我已经设法转换了大多数规则,但是其中两个我无法与ESLint规则集匹配。 So before I dig into AST and trying to write it on my own, I would like to ask if these aren't already in there. 因此,在深入研究AST并尝试自己编写它之前,我想问一下它们是否还不存在。

{
    // nothing similar to this seems available
    "requireBlocksOnNewline": 2,
    // there is only rule for after spaces - space-after-keywords
    "requireSpaceBeforeKeywords": ["else", "while", "catch"]
}

http://jscs.info/rule/requireBlocksOnNewline.html http://jscs.info/rule/requireSpaceBeforeKeywords.html http://jscs.info/rule/requireBlocksOnNewline.html http://jscs.info/rule/requireSpaceBeforeKeywords.html

brace-style: [2, "1tbs"]可以模仿requireBlockOnNewline brace-style: [2, "1tbs"] requireSpaceBeforeKeywords不存在,但是创建起来并不难。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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