Skip to content

Evaluate new rules in new versions of Angular #134

Open
@jattasNI

Description

@jattasNI

In Angular 16, angular-eslint contains some new rules and breaking changes. We will need to publish an update to our Angular styleguide that supports 16 at a minimum and preferably configures the new rules in an opinionated way.

Changelog contents copied below for easier discussion:

Features

eslint-plugin-template: All accessibility rules are now grouped together and exposed via a new @angular-eslint/template/accessibility config. See the main README.md for an example of it in action. Our schematics will explicitly add it for you in new configs, but you are free to remove it if you wish (also note the BREAKING CHANGE regarding accessibility rule names below)
builder: support reportUnusedDisableDirectives option
builder: respect using eslint.config.js (a.k.a Flat Config) if it is already present. Our schematics will only be updated to generate Flat Config once it is the default way of configuring ESLint later in the year.
bump eslint and all @typescript-eslint packages to the latest (handled for you automatically by our ng update schematic)

BREAKING CHANGES

As always, the major version primarily communicates the alignment with Angular's major version. Only Angular 16 is supported by angular-eslint 16.
Your Node version must now be 16.13.0 or higher. Node 14 support has been dropped in alignment with Angular 16, as Node 14 is EOL.
eslint-plugin: The legacy base, recommended--extra, ng-cli-compat and ng-cli-compat--formatting configs have been removed. See the updated guide on migrating from TSLint for more information: [./docs/MIGRATING_FROM_TSLINT.md](https://github.com/angular-eslint/angular-eslint/blob/main/docs/MIGRATING_FROM_TSLINT.md)
eslint-plugin-template: The legacy base config has been removed. See the updated guide on migrating from TSLint for more information: [./docs/MIGRATING_FROM_TSLINT.md](https://github.com/angular-eslint/angular-eslint/blob/main/docs/MIGRATING_FROM_TSLINT.md)
schematics: The legacy convert-tslint-to-eslint schematic has been removed. See the updated guide on migrating from TSLint for more information: [./docs/MIGRATING_FROM_TSLINT.md](https://github.com/angular-eslint/angular-eslint/blob/main/docs/MIGRATING_FROM_TSLINT.md)
eslint-plugin-template: The deprecated accessibility-label-for rule has been removed. label-has-associated-control should be used instead. An automated migration was provided when label-has-associated-control was first added, so hopefully this should not impact too many folks.
eslint-plugin-template: Previously some, but not all, accessibility related rules had a prefix of accessibility- in their name. This is inconsistent with all other rules which do not attempt to communicate why they exist in their names. Therefore that naming prefix has been removed from all rules for consistency. The accessibility related rules can easily be identified from the new @angular-eslint/template/accessibility shared config. See the main README.md for an example of it in action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions