我应该在Typescript> 2还是TSLint中使用内置的linter?

时间:2017-05-30 11:22:23

标签: typescript lint

我试图决定为什么我应该在TSLint / Typescript2项目中使用Angular2

TSLint公开的规则列表:https://palantir.github.io/tslint/rules/

使用TypeScript提供的编译器选项:https://www.typescriptlang.org/docs/handbook/compiler-options.html

由于Typescript2现在有一些编译器选项,例如--noUnusedParameters,是否真的需要TSLintTSLint是编译器选项的超集吗?

项目结构:

.
├── bower.json
├── index.js
├── package.json
├── src
│   ├── app
│   │   ├── app.component.spec.ts
│   │   ├── app.component.ts
│   │   └── app.module.ts
│   ├── index.html
│   ├── main.ts
│   └── tsconfig.json
├── tslint.js
├── webpack.common.js
└── webpack.dev.config.js

2 个答案:

答案 0 :(得分:6)

TSLint在将规则添加到适当的TypeScript时会删除规则。但是,还有很多规则,而TypeScript不会检查这些规则,所以如果你关心它,你可能想要同时使用它们。

答案 1 :(得分:1)

我很高兴地将Typescript Library Starter的TSLint与TSLint config standard结合使用,这不仅为您提供了更广泛的规则,而且还旨在实现标准化。

相关问题