所以我无法理解如何进行标准化并激活 tslint.json
中的半规则检查选项。因为目前它不会检查 TypeScript 中的 Types
也不会产生任何错误。同样在 Interfaces
中,它正常工作,并且当我使用与 ;
不同的东西时会抛出错误,那么我怎样才能为 Types
制作它呢? ..
export type IProps = {
active?: boolean, // no error
title?: string; // no error
text?: string // no error
}
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"
],
}
}
最佳答案
您正在寻找type-literal-delimiter
rule 。只需在 tslint.json
中将其从 false
更改为 true
即可。
关于javascript - typescript 。 ESLint 不适用于类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52761418/