Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/372.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 打字稿。TSLint不适合任何类型_Javascript_Typescript_Tslint - Fatal编程技术网

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干得好