-
Notifications
You must be signed in to change notification settings - Fork 26.6k
Description
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Apologizes for using the wrong issue template here: this is a tooling suggestion for this repository itself, not an end-user-facing request. I asked on the Angular Discord where to post and this was the best guess.
Angular uses TSLint for its internal linting (tslint.json
) right now, although TSLint was deprecated years ago. TSLint doesn't support all new TypeScript features and hasn't been actively worked on since 2020. Its replacement is ESLint with typescript-eslint.
Some related issues & PRs from searching tslint in:title
:
- TSLint has been deprecated in favor of ESLint #37843 -> Migration to ESLint angular-cli#13732: user-facing, not the same as this one
- TSLint is the default linting tool for angular? #42639: user-facing, not the same as this one
- refactor(docs-infra): migrate from tslint to eslint #42820: only part of the way
Proposed solution
I propose incrementally switching over to ESLint. One common strategy many repositories go with is:
- Add ESLint separately from TSLint, integrated into the same build processes
- Remove old built-in rules from the TSLint config and replace them with their new ESLint equivalents
- Tip: https://github.com/typescript-eslint/tslint-to-eslint-config is the standard helper there
- Remove old custom and plugin rules from the TSLint config and rewrite and/or replace them with new custom and/or plugin equivalents
- Tip: for anything that can be generalized, this is a great time for adding a new or existing
eslint-plugin-*
package!
- Tip: for anything that can be generalized, this is a great time for adding a new or existing
- Once there are no more TSLint rules in use, remove it altogether
I'd be happy to help with this! "Killing TSLint" is IMO helpful for the ecosystem: both to get projects on the latest+greatest tooling, and to help get more community input into ESLint + typescript-eslint.
Alternatives considered
I suppose Angular could stay on TSLint in perpetuity, which would be a real bummer. Or even fork the old TSLint codebase - structural issues and all.
Another alternative would be a linter besides ESLint. There are some Rust-based ones such as Biome, deno lint
, and Oxc / oxlint
- though none yet support linting with type information yet. Alternately, tsslint is also in development, though it's not clear that it's quite the same maturity yet as the others.
My understanding is that Google still uses TSLint internally, and having this public angular/angular repo also use TSLint has some nice benefits for tooling. It'd be great to know if that's the case, and if so, whether an initiative to migrate the tooling over to a newer tool would be desirable + feasible.