D
D
Drovosek012021-05-12 21:08:55
Angular
Drovosek01, 2021-05-12 21:08:55

How to write a rule for TSLint with an error correction function?

Good day.

You need to write a rule in your Angular8+ project to lint .ts files.
Those guides that I found on the first two pages of Yandex and Google search results only show how to write a rule that shows an error.

I want to write a rule that can fix this error.
Well, so that you can hover over the error, click Quick Fix and one of the options will be a fix that I implement in my tslint rule or just run the linter with --fix-all and all errors will be fixed.
609c19b283e7d369933231.png

Actually, tell me, where are the guides / manuals on how, in addition to finding an error, write a function for fixing it in a custom rule for tslint?
Or just look at the source code of the standard rules and do it in the image and likeness?

PS
Yes, I know that tslint is "outdated" and you need to move to eslint, but the project currently has tslint and there are things tailored for it.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question