Tslint: 启用 Strict,如果没有 --strictNullChecks,“strict-type-predicates 将不起作用”

创建于 2017-10-19  ·  3评论  ·  资料来源: palantir/tslint

错误报告

  • __TSLint 版本__:5.7.0
  • __打字稿版本__:2.5.3
  • __通过__运行TSLint:CLI

我在一个带有tsconfig.json的目录中运行tslint -p . ,它有"strict": true ,但我得到了这个:

strict-type-predicates does not work without --strictNullChecks

我在 #2786 中看到它应该检查它。 我错过了什么吗?

Not A Bug

最有用的评论

strictcompilerOption ,它在 tsconfig.json 的顶层不正确。 它应该是这样的:

{
    "compilerOptions": {
        "strict": true
    }
}

所有3条评论

例如,克隆https://github.com/cretz/awss/tree/05eb0c7adb22fb4feab92c1f190a752f8cfec921 , cd 到proj ,然后运行npm run lint

strictcompilerOption ,它在 tsconfig.json 的顶层不正确。 它应该是这样的:

{
    "compilerOptions": {
        "strict": true
    }
}

我的错误,谢谢!

此页面是否有帮助?
0 / 5 - 0 等级