I'm trying to decide why I should use TSLint
in my Typescript2
/Angular2
project.
List of rules exposed by TSLint
: https://palantir.github.io/tslint/rules/
Compiler options available using 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
? Is TSLint
a superset of the compiler options?
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 can only be used for TypeScript, while ESLint supports both JavaScript and TypeScript. It is likely, within a large project that you may use both JavaScript and TypeScript.
TSLint has been the recommended linter in the past but now TSLint is deprecated and ESLint is taking over its duties.
Ts lint is deprecated now. It still works totally fine, but if you want to stay current in your next typescript project you should use ESlint. If you have an existing code base using TsLint you should upgrade as soon as possible. The primary benefit of moving to Eslint is that you get continuous updates from the team.
Palantir, the creators of TSLint, recently announced the deprecation of TSLint, putting their support behind typescript-eslint to consolidate efforts behind one unified linting solution for TypeScript users. Discussions between the TypeScript team, ESLint team, and TSLint team have been ongoing.
TSLint removes rules when they are added to TypeScript proper. 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.
I'm happily using TSLint for Typescript Library Starter in combination with TSLint config standard which not only offers you a widen set of rules, but also they aim to be standardised.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With