Skip to content

dev-infra: run TSLint rules on top of TSSLint#59364

Closed
johnsoncodehk wants to merge 2 commits intoangular:mainfrom
johnsoncodehk:tsslint
Closed

dev-infra: run TSLint rules on top of TSSLint#59364
johnsoncodehk wants to merge 2 commits intoangular:mainfrom
johnsoncodehk:tsslint

Conversation

@johnsoncodehk
Copy link
Copy Markdown
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe: Refactor the linting infrastructure

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

I am the author of TSSLint 👋. TSSLint is a newer linting solution. It is mainly built to improve the linting experience and performance in TS projects.

Since the TSLint related tool chain is no longer maintained, and the API design of TSSLint has good compatibility with TSLint, I think running TSLint rules on top of TSSLint is a feasible solution to regain a good linting experience.

The switch required very few changes, mainly rewriting tslint.json to tsslint.config.ts, and we found some clear benefits:

  • The TSLint VSCode extension is no longer available with the latest TS/VSCode version. Switching to TSSLint will regain IDE support.
  • TSSLint cache non-type-aware rules's results by default, which greatly reduces the time for CLI to perform linting. (19.106s -> 7.740s)
  • TSSLint natively supports writing config/rules in TS, so tsNodeLoaderRule/ts-node is no longer necessary.
  • tslint:disable-next-line:, tslint:disable: are supported through the plugin API. By enabling the second parameter of createIgnorePlugin() we found many unused tslint:disable-next-line:, tslint:disable: comments.
  • The way to write custom rules is simpler than TSLint.

I hope this PR helps you simply start testing TSSLint, but if Angular team ultimately decide that staying with TSLint is more appropriate, that's a perfectly acceptable conclusion and feel free to close this PR.

Thank you for reading this far!

@google-cla
Copy link
Copy Markdown

google-cla bot commented Jan 4, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@pullapprove pullapprove bot requested a review from josephperrott January 4, 2025 20:55
@JeanMeche
Copy link
Copy Markdown
Member

JeanMeche commented Jan 4, 2025

Hi,
The project is not interesting in diverging its linting setup from what's used internaly at Google (tslint).
Thank you for your understanding.

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants