Monorepo for all the tooling which enables ESLint to lint Angular projects
This project is made possible thanks to the continued hard work going into https://github.com/typescript-eslint/typescript-eslint, and brilliant work on the original TSLint rule implementations in https://github.com/mgechev/codelyzer.
Feel free to begin playing with the tooling in your own projects and submit PRs with missing rules and bug fixes.
We would also be very grateful for documentation PRs!
Please follow the links below for the packages you care about.
-
@angular-eslint/builder
- An Angular CLI Builder which is used to execute ESLint on your Angular projects using standard commands such asng lint
- This package is also used to power ESLint usage within https://github.com/nrwl/nx workspaces, regardless of which framework is being used.
-
@angular-eslint/eslint-plugin
- An ESLint-specific plugin that contains rules which are specific to Angular projects. It can be combined with any other ESLint plugins in the normal way. -
@angular-eslint/template-parser
- An ESLint-specific parser which leverages the@angular/compiler
to allow for custom ESLint rules to be written which assert things about your Angular templates. -
@angular-eslint/eslint-plugin-template
- An ESLint-specific plugin which, when used in conjunction with@angular-eslint/template-parser
, allows for Angular template-specific linting rules to run.
If you are looking for general help in migrating from TSLint to ESLint, you can check out this project: https://github.com/typescript-eslint/tslint-to-eslint-config
For Angular project's specifically, the migration involves a few different aspects:
-
Replacing the builder the Angular CLI will use when you run
ng lint
-
Replacing your
tslint.json
files with.eslintrc.json
files -
Populating the
.eslintrc.json
files appropriately to match the previous setup you had in the Codelyzer + TSLint world
The best source of information for performing this migration is located within the Angular CLI integration test within this monorepo. Check out the relevant configuration files:
- packages/integration-tests/fixtures/angular-cli-workspace/.eslintrc.js
- packages/integrati 5CEB on-tests/fixtures/angular-cli-workspace/angular.json
Soon we will provide an example project and also an ng add
schematic to handle all of this for you automatically.
If you are interested in creating this, we would be very grateful to receive a PR in the meantime!
Help wanted to document previous Codelyzer rules and progress made so far in this repo!
Please use this as inspiration: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/ROADMAP.md
You can also see how the setup and rules are mapped within the integration test setup: packages/integration-tests/fixtures/angular-cli-workspace/.eslintrc.js