Javascript 打字稿。TSLint不适合任何类型
因此,我无法理解如何进行标准化并在Javascript 打字稿。TSLint不适合任何类型,javascript,typescript,tslint,Javascript,Typescript,Tslint,因此,我无法理解如何进行标准化并在tslint.json中激活半规则检查选项。因为现在它不会检查TypeScript中的类型,也不会产生任何错误。同样在接口中它正常工作,当我使用与不同的东西时抛出错误,那么我如何也为类型制作它呢 export type IProps = { active?: boolean, // no error title?: string; // no error text?: string // no error } tslint.json:
tslint.json
中激活半规则检查选项。因为现在它不会检查TypeScript中的类型
,也不会产生任何错误。同样在接口中
它正常工作,当我使用与不同的东西时抛出错误
,那么我如何也为类型制作它呢
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"
],
}
}
你在找那个。只需在tslint.json中将其从false
更改为true
。json@wgcrouch干得好