Excerpt from Wikipedia:
Lint, or a linter, is a static code analysis tool used to flag programming errors, bugs, stylistic errors and suspicious constructs. The term originates from a Unix utility that examined C language source code.
Opposing to this, TSLint emerged as the defacto standard linting tool for TypeScript projects. But to simplify the experience for developers switching to TypeScript, ESLint began to incorporate features specific to TSLint. In 2019, TSLint stopped active development of new features, and encourages it's users to migrate to ESLint. You can read more details about this decision on the Palantir Blog.
You can find all necessary tools and information to simplify the migration of existing Angular projects to ESLint at the GitHub Repo Angular ESLint.
First you have to add the relevant packages as dev dependencies by using the following command:
ng add @angular-eslint/schematics
Now you can use
convert-tslint-to-eslint. This will remove all TSLint specific configuration. It also creates the necessary files for ESLint and converts references in NPM scripts or code comments like
ng g @angular-eslint/schematics:convert-tslint-to-eslint
That's it! You can now execute ESLint by running the following of your command line:
npm run lint
ESLint has a variety of integrations for various dev tools. You can find a full list at the ESLint user guide.
To integrate ESLint into VS Code, you can install the wonderful plugin called, well, ... ESLint (dbaeumer.vscode-eslint)
I would also recommend you to install the optional, but nevertheless interesting LintLens (ghmcadams.lintlens). It gives you additional infos about the configured linting rules directly while editing your
And this is all you need to migrate your existing Angular applications from TSLint to ESLint. I hope this post will help someone out there, so please share it if you like!