简体   繁体   English

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

[英]Should I use the built in linter in Typescript >2 or TSLint?

I'm trying to decide why I should use TSLint in my Typescript2 / Angular2 project. 我试图决定为什么我应该在我的Typescript2 / Angular2项目中使用TSLint

List of rules exposed by TSLint : https://palantir.github.io/tslint/rules/ TSLint公开的规则列表: httpsTSLint

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

Since Typescript2 now has some compiler options such as --noUnusedParameters , is there really a need for TSLint ? 由于Typescript2现在有一些编译器选项,如--noUnusedParameters ,是否真的需要TSLint Is TSLint a superset of the compiler options? TSLint是编译器选项的超集吗?

Project structure: 项目结构:

.
├── 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

TSLint removes rules when they are added to TypeScript proper. 当TSLint正确添加到TypeScript时,它会删除规则。 There's still a lot of rules in there that TypeScript doesn't check for, though, so if you care about it, you'll probably want to use both. 但是,仍有很多规则,TypeScript不会检查,所以如果你关心它,你可能想要同时使用它们。

我很高兴使用TSLint for Typescript Library Starter结合TSLint配置标准 ,它不仅为您提供了更广泛的规则,而且还旨在实现标准化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM