![](/img/trans.png)
[英]How do I enforce a check for a particular sequence of parameters in the querystring of an http request handled by a node.js server?
[英]How do I enforce the opposite of whitespace check-branch in TSLint?
我想强制执行与空白检查分支相反的操作。 所以不要这样:
if (condition) {
return true;
} else {
return false;
}
我要执行此操作:
if(condition) {
return true;
} else {
return false;
}
对于大多数人来说,这似乎很奇怪,但这就是我们团队喜欢编码的方式。
我尝试这样做:
"whitespace": [
false,
"check-branch"
]
但是没有给我想要的结果。 有谁知道是否可以执行我们的编码方式?
不支持此AFAIK。 我建议您自己为公司制定规则。
有关如何添加规则的文章,请参见https://palantir.github.io/tslint/develop/custom-rules/ 。 以下是whitespace
规则实现的参考: https : //github.com/palantir/tslint/blob/master/src/rules/whitespaceRule.ts
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.