What is @angular-eslint/schematics?
@angular-eslint/schematics is a package that provides a set of schematics for integrating ESLint into Angular projects. It helps in setting up and managing linting configurations, converting TSLint configurations to ESLint, and generating new Angular components with ESLint configurations.
What are @angular-eslint/schematics's main functionalities?
Converting TSLint to ESLint
This schematic converts an existing Angular project that uses TSLint to use ESLint instead. It updates the configuration files and installs the necessary dependencies.
ng g @angular-eslint/schematics:convert-tslint-to-eslint
Generating new Angular components with ESLint
This schematic generates a new Angular component with ESLint configurations applied. It ensures that the new component adheres to the linting rules defined in the project.
ng g @angular-eslint/schematics:component my-component
Setting up ESLint in a new Angular project
This schematic sets up ESLint in a new Angular project. It configures the necessary files and installs the required dependencies to start using ESLint for linting the project.
ng add @angular-eslint/schematics
Other packages similar to @angular-eslint/schematics
eslint
ESLint is a popular linting tool for JavaScript and TypeScript. While it does not provide Angular-specific schematics, it can be configured to work with Angular projects by using plugins and custom configurations.
tslint
TSLint is a linting tool for TypeScript. It was commonly used in Angular projects before the community started migrating to ESLint. TSLint is now deprecated in favor of ESLint.
angular-cli
Angular CLI is a command-line interface for Angular. It provides various commands for generating and managing Angular projects, including setting up linting configurations. However, it does not specifically focus on ESLint integration like @angular-eslint/schematics.
@angular-eslint/schematics
2.0.0 (2021-03-13)
We have provided automated migrations for you to move to v2.
All you need to do is first update to Angular and Angular CLI v11.2.0 or above (see https://update.angular.io for full instructions relating to Angular updates):
npx ng update @angular/cli @angular/core
And then run the update schematics for @angular-eslint
:
npx ng update @angular-eslint/schematics
Bug Fixes
Features
BREAKING CHANGES
-
The format of results output has changed
-
The use-pipe-decorator
rule no longer exists for use
-
feat(template-parser): updated use of parseTemplate to improve loc data
- Requires @angular/compiler 11.2.0 and above
-
feat(schematics): change way indent and quotes are handled by conversion schematics
- The conversion schematic handle these rules differently