我试图决定为什么我应该在TSLint
/ Typescript2
项目中使用Angular2
。
TSLint
公开的规则列表:https://palantir.github.io/tslint/rules/
使用TypeScript
提供的编译器选项:https://www.typescriptlang.org/docs/handbook/compiler-options.html
由于Typescript2
现在有一些编译器选项,例如--noUnusedParameters
,是否真的需要TSLint
? TSLint
是编译器选项的超集吗?
项目结构:
.
├── 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
答案 0 :(得分:6)
TSLint在将规则添加到适当的TypeScript时会删除规则。但是,还有很多规则,而TypeScript不会检查这些规则,所以如果你关心它,你可能想要同时使用它们。
答案 1 :(得分:1)
我很高兴地将Typescript Library Starter的TSLint与TSLint config standard结合使用,这不仅为您提供了更广泛的规则,而且还旨在实现标准化。