[英]TypeScript. TSLint does not wok in Types
So I cannot understand how to make standardisation and activate semi rule checking option in tslint.json
. 所以我不明白如何在
tslint.json
进行标准化和激活半规则检查选项。 Because for now it does not checks and not produces any error for Types
in TypeScript. 因为到目前为止,它不会检查TypeScript中的
Types
并且不会对Types
产生任何错误。 Also in Interfaces
it wokrs normally and throw an error when I use something different that ;
同样在
Interfaces
它正常运转,当我使用其他东西时抛出错误;
, so how can I make it for Types
too?... ,那么我也该如何为
Types
它?...
export type IProps = {
active?: boolean, // no error
title?: string; // no error
text?: string // no error
}
tslint.json: tslint.json:
{
"defaultSeverity": "error",
"extends": [
"tslint-config-airbnb",
"tslint-eslint-rules",
"tslint-react"
],
"jsRules": {},
"rulesDirectory": [],
"rules": {
"arrow-parens": false,
"whitespace": [
false,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
}
}
You're looking for the type-literal-delimiter
rule . 您正在寻找
type-literal-delimiter
规则 。 Just change it from false
to true
in your tslint.json
. 只需在
tslint.json
其从false
更改为true
tslint.json
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.