Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

angular-eslint

angular-eslint1.4mMIT19.3.0TypeScript support: included

The tooling which enables ESLint to work with Angular projects

readme

angular-eslint-logo

Angular ESLint

Monorepo for all the tooling which enables ESLint to lint Angular projects

Build Status NPM Version GitHub license NPM Downloads Codecov Commitizen friendly


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.


Contents


Quick Start

  1. Follow the local environment and workspace setup guide in order to install the Angular CLI

  2. Create a new Angular CLI workspace in the normal way, optionally using any of the supported command line arguments and following the interactive prompts:

ng new # --maybe --some --other --flags --here
  1. Change directory into your new workspace and then use the Angular CLI to add angular-eslint.
ng add angular-eslint

...and that's it!

As well as installing all relevant dependencies, the ng add command will automatically detect that you have a workspace with a single project in it, which does not have a linter configured yet. It can therefore go ahead and wire everything up for you!

You will also see that it added the following in your angular.json:

  "cli": {
    "schematicCollections": ["angular-eslint"]
  }

Read the section on Using ESLint by default when generating new Projects within your Workspace to understand why this is useful.


Supported Angular CLI Versions

As of v12, we aligned the major version of the @angular-eslint/ packages with Angular (and Angular CLI).

Therefore, as an example (because these versions may or may not exist yet when you read this):

  • @angular-eslint/ packages at 16.x.x and @angular/cli@16.x.x are compatible
  • @angular-eslint/ packages at 17.x.x and @angular/cli@17.x.x are compatible
  • @angular-eslint/ packages at 18.x.x and @angular/cli@18.x.x are compatible
  • ...and so on...

NOTE: the exact minor and patch versions of each library represented here by x's do not need to match each other, just the first (major) number

For an understanding of Angular CLI version support prior to v12, please see ./docs/ANGULAR_VERSION_SUPPORT.md

Please do not open issues related to unsupported versions of the Angular CLI.


Supported ESLint Versions

See the specified peerDependency in any of our packages, such as the eslint-plugin: https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/package.json


Usage with Nx Monorepos

Nx leans on some, but not all of the packages from this project.

Specifically:

  • It does not use the builder to execute ESLint
  • It does not use the schematics to generate files and config, and is responsible for configuring ESLint via .eslintrc.json or eslint.config.js files in a way that makes sense for Nx workspaces.

We strongly recommend that you do not try and hand-craft setups with angular-eslint and Nx. It is easy to get things wrong.

  • If using Angular CLI, use the angular-eslint tooling as instructed below
  • If using Nx, defer to the Nx tooling itself to configure things for you, it has been designed and tested specifically for this purpose.

Issues specific to Nx's support of Angular + ESLint should be filed on the Nx repo: https://github.com/nrwl/nx


Packages included in this project

Please follow the links below for the packages you care about.

  • angular-eslint - This is the core package that exposes most of the other packages below for the common use case of using angular-eslint with Angular CLI workspaces. It exposes all the tooling you need to work with ESLint v9 and typescript-eslint v8 with flat config in v18 of angular-eslint onwards. For versions of angular-eslint older than v18, or workspaces still using ESLint v8 and typescript-eslint v7 or the legacy eslintrc config format, you will use a combination of the packages below directly.

  • @angular-eslint/builder - An Angular CLI Builder which is used to execute ESLint on your Angular projects using standard commands such as ng lint

  • @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/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.

  • @angular-eslint/schematics - Schematics which are used to add and update configuration files which are relevant for running ESLint on an Angular workspace.

  • @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/test-utils - Utilities which are helpful when testing custom ESLint rules for Angular workspaces.

  • @angular-eslint/utils - Utilities which are helpful when writing custom ESLint rules for Angular workspaces.


Package Versions

All of the packages are published with the same version number to make it easier to coordinate both releases and installations.

We publish a canary release on every successful merge to the main branch, so you never need to wait for a new stable version to make use of any updates.

The latest version under the latest tag is:

NPM Version

The latest version under the canary tag (latest commit to the main branch) is:

NPM Version

(Note: The only exception to the automated publishes described above is when we are in the final phases of creating the next major version of the libraries - e.g. going from 1.x.x to 2.x.x. During these periods, we manually publish pre-releases until we are happy with it and promote it to latest.)


Adding ESLint configuration to an existing Angular CLI project which has no existing linter

NOTE: If you are looking for instructions on how to migrate a project which uses TSLint, please see the bottom of the README.

If you want to add ESLint configuration (either a eslint.config.js file for flat config, or a .eslintrc.json file for eslintrc (angular-eslint will figure this out for you automatically) and an applicable "lint" target in your angular.json) to an existing Angular CLI project which does not yet have a linter set up, you can invoke the following schematic:

ng g angular-eslint:add-eslint-to-project {{YOUR_PROJECT_NAME_GOES_HERE}}

If you only have a single project in your Angular CLI workspace, the project name argument is optional


Using ESLint by default when generating new Projects within your Workspace

Regardless of whether or not you added angular-eslint to a brand new workspace, or you added it in order to convert a project within an existing workspace, it is likely that from now on you want any subsequent projects that you generate in your workspace to also use ESLint.

In order to achieve this, angular-eslint provides a set of custom generator schematics which sit on top of the default ones that the Angular CLI provides. They provide all the standard Angular CLI options, but just handle adding ESLint related configuration for you in each case.

You can always invoke them directly by specifying the collection name as part of the generate command:

# To generate a new Angular app in the workspace using ESLint
ng g angular-eslint:application
# To generate a new Angular library in the workspace using ESLint
ng g angular-eslint:library

Or, alternatively, if you don't want to have to remember to set that collection prefix in front of the : every time, you can set the schematicCollections in your angular.json to start with angular-eslint.

You can either do that by hand by adjusting the JSON, or by running the following Angular CLI command:

ng config cli.schematicCollections "[\"angular-eslint\"]"

The final result in your angular.json will be something like this:

  "cli": {
    "schematicCollections": ["angular-eslint"]
  }

Now your generate commands can just be:

# To generate a new Angular app in the workspace using ESLint (thanks to the schematicCollections set above)
ng g app
# To generate a new Angular library in the workspace using ESLint (thanks to the schematicCollections set above)
ng g lib

Configuring ESLint

In version 9 of ESLint, they changed their default configuration format to the so called "flat config" style using exclusively a eslint.config.js file as the only way of configuring a project: https://eslint.org/blog/2024/04/eslint-v9.0.0-released/

The legacy so called "eslintrc" style is now deprecated, but still fully supported, and so when it comes to configuring ESLint for your Angular projects you have two options and associated guides:


Philosophy on lint rules which enforce code formatting concerns

Please see here for our philosophy on using a linter to enforce code formatting concerns: ./docs/FORMATTING_RULES.md

TL;DR - We will not be maintaining code formatting rules in this project, but you are very welcome to create them yourself using our tooling such as @angular-eslint/utils and @angular-eslint/test-utils.


Linting with the VSCode extension for ESLint

We strongly recommend using v3 (or later) of the vscode-eslint extension.. You can enable it by opening up the extension profile page within VSCode.

The extension will now be smart enough to pick up from your configuration files what files you care about linting (from both flat configs and eslintrc (as long as you follow the guidance of using overrides outline in this repo)).

The only configuration option you need to care about is if you are using ESLint v9 and still using eslintrc configuration files (because flat config is the default in ESLint v9). In this case you need to set in your .vscode/settings.json:

// ... more config
"eslint.useFlatConfig": false,
// ... more config

For full information about the extension see: https://github.com/microsoft/vscode-eslint


Usage without Angular CLI Builder and eslintrc style configs

NOTE: This is only applicable when you are using eslintrc configs. For flat config, no custom --ext option is needed.

If you're using this without the Angular CLI Builder (and eslintrc configs), don't forget to include .html as one of the file extensions when running the eslint CLI, otherwise templates will not be linted, e.g.:

eslint --ext .ts,.html .

Notes on performance

Background and understanding the trade-offs

As you have hopefully understood from the above section on ESLint configuration what we are dealing with here is a set of tools that were not designed and optimized for this specific use-case.

In software development we are permanently faced with trade-offs. In this case you can think about it this way:

On the one hand...

By using ESLint with Angular (both its TypeScript source code, and its HTML templates), we gain access to a truly massive ecosystem of existing rules, plugins and IDE extensions that we can instantly leverage on our projects.

On the other...

The tooling will never be as fast or memory efficient, or as easy to configure, as something which was purpose built for a narrower use-case and which, well, does less...

TSLint was more in the latter camp - it was purpose built for linting TypeScript source code (note, not HTML), and so it was (depending on the codebase) faster and more efficient at doing it - but it was hugely lacking in community support, features, plugins, rules etc...

As of v15, we generate the fastest possible lint config for you out of the box (rather than the most flexible lint config), but it is possible that you will need to leverage rules which require type information, and this requires extra consideration.

Please read this dedicated guide to fully understand lint performance and how it is impacted by rules requiring type information: ./docs/RULES_REQUIRING_TYPE_INFORMATION.md


Using eslint-disable comments in Angular templates

If you want to be able to use eslint-disable comments in your Angular templates you just need to ensure you are using:

  • @angular CLI tooling packages version 11.2.8 or higher
  • @angular-eslint tooling packages version 2.1.0 or higher

Make sure you are using valid HTML comments, i.e. <!-- this syntax -->, not the kind of comments you use in TypeScript code.


Migrating an Angular CLI project from Codelyzer and TSLint

Please see here for the legacy information around converting from Codelyzer and TSLint prior to version 16: ./docs/MIGRATING_FROM_TSLINT.md

changelog

19.3.0 (2025-03-22)

🚀 Features

  • use @angular/compiler 19.2.3 and rename some AST nodes to match (#2320)
  • eslint-plugin-template: [button-has-type] add option to ignore missing type (#2326)
  • eslint-plugin-template: add rule prefer-contextual-for-variables (#2311)
  • template-parser: visit @let child nodes (#2312)

🩹 Fixes

  • update typescript-eslint packages to v8.26.1 (#2313)
  • update typescript-eslint packages to v8.27.0 (#2328)
  • update dependency eslint to v9.23.0 (#2331)
  • eslint-plugin-template: [i18n] Avoid exception in i18n rule with allowMarkupInContent=false (#2327)
  • eslint-plugin-template: [attributes-order] order i18n attributes (#2307)
  • eslint-plugin-template: [attributes-order] treat inputs without square brackets as attributes (#2316)

❤️ Thank You

  • Dave @reduckted
  • m-akinc @m-akinc

19.2.1 (2025-03-08)

🩹 Fixes

  • update dependency @angular/compiler to v19.2.1 (#2288)
  • update dependency eslint-scope to v8.3.0 (#2296)
  • update typescript-eslint packages to v8.26.0 (#2282)
  • update dependency eslint to v9.22.0 (#2294)
  • eslint-plugin-template: [prefer-self-closing-tags] resolve wrong reports when structural directive + no content + no self-closing (#2287)

❤️ Thank You

  • Guillaume DROUARD

19.2.0 (2025-03-02)

🚀 Features

  • eslint-plugin: add rule require-lifecycle-on-prototype (#2259)

🩹 Fixes

  • update dependency @angular/compiler to v19.2.0 (#2268)
  • update dependency eslint to v9.21.0 (#2243)
  • update typescript-eslint packages to v8.25.0 (#2263)
  • eslint-plugin: [no-output-native] update native event names (#2236)
  • eslint-plugin-template: [prefer-self-closing-tags] do not treat comments as whitespace (#2256)
  • eslint-plugin-template: [prefer-self-closing-tags] allow nested ng-content (#2257)
  • eslint-plugin-template: [prefer-static-string-properties] do not check structural directives (#2253)
  • eslint-plugin-template: find inline templates on components in blocks (#2238)
  • prefer-static-string-properties: resolve bug with directives (#2271)
  • prefer-static-string-properties: exclude special attributes (#2273)

❤️ Thank You

  • Dave @reduckted
  • Marie Briand @mbriand-lucca

19.1.0 (2025-02-09)

🚀 Features

  • eslint-plugin: prefer-signals read-only suggestion is now a fix (#2175)
  • eslint-plugin: prefer-signals now checks .asReadonly() calls (#2218)
  • eslint-plugin-template: add rule prefer-static-string-properties (#2228)

🩹 Fixes

  • update dependency ignore to v7 (#2200)
  • update dependency @angular/compiler to v19.1.5 (#2226)
  • update dependency semver to v7.7.1 (#2225)
  • update typescript-eslint packages to v8.23.0 (#2212)
  • update dependency eslint to v9.20.0 (#2217)
  • eslint-plugin: [prefer-signals] support linkedSignal (#2213)
  • eslint-plugin: [no-input-prefix] false positive on input initializer value (#2184)
  • eslint-plugin-template: [prefer-self-closing-tags] do not remove HTML-encoded whitespace (#2229)
  • eslint-plugin-template: [attribute-order] check for ng-template within svg (#2223)

❤️ Thank You

  • Cédric Exbrayat @cexbrayat
  • Dave @reduckted
  • Lucas Neto Moreira

19.0.2 (2024-12-10)

🩹 Fixes

  • update typescript-eslint packages to v8.18.0 (#2171)
  • eslint-plugin: [prefer-standalone] error range should only include property and value (#2172)

❤️ Thank You

  • James Henry @JamesHenry

19.0.1 (2024-12-06)

🩹 Fixes

  • update dependency @angular/compiler to v19.0.3 (#2159)
  • update dependency eslint to v9.16.0 (#2148)
  • update typescript-eslint packages to v8.17.0 (#2153)
  • eslint-plugin: add prefer-signals rule to exported config (#2150)
  • eslint-plugin-template: prevent the slot tag from being self-closing (#2088)

❤️ Thank You

  • Joan Llenas @joanllenas
  • Quentin Deroubaix @quentinderoubaix

19.0.0 (2024-11-29)

As always we recommend that you update your existing workspaces by using ng update as we provide some helpful schematics to help migrate your workspaces to the latest and greatest.

However, please note that the angular-eslint package itself now supports being referenced as the schematics collection, so...

IF YOU ARE ALREADY USING angular-eslint and ESLint v9 and flat config you can now do the following:

ng update @angular/core @angular/cli angular-eslint

(Note: If you encounter any issues with this, you may need to update to the latest v18 release of angular-eslint first)

IF YOU ARE STILL USING @angular-eslint/schematics and ESLint v8 and .eslintrc.json configs you can still do the following:

ng update @angular/core @angular/cli @angular-eslint/schematics

NOTE: There will not be any migration of your setup to ESLint v9 or flat configs for existing ESLint v8 workspaces while migrating to angular-eslint v19.

We will explore landing an opt in migration schematic in a minor release after 19.0.0.

🚀 Features

  • update angular packages to the stable v19 (#2120)
  • allow referencing angular-eslint as the schematics collection (2be3107b)
  • ⚠️ eslint-plugin: remove deprecated prefer-standalone-component rule (#2112)
  • ⚠️ eslint-plugin: prefer-standalone recognizes that standalone is the default (#2096)
  • ⚠️ eslint-plugin: remove deprecated sort-ngmodule-metadata-arrays rule (#2114)
  • ⚠️ eslint-plugin: remove deprecated no-host-metadata-property rule (#2113)
  • eslint-plugin: new rule prefer-signals (#1872)
  • ⚠️ eslint-plugin: promote prefer-standalone to recommended (8dfdc4f4)

⚠️ Breaking Changes

  • ⚠️ eslint-plugin: promote prefer-standalone to recommended (8dfdc4f4)
  • ⚠️ eslint-plugin: remove deprecated no-host-metadata-property rule (#2113)
  • ⚠️ eslint-plugin: remove deprecated sort-ngmodule-metadata-arrays rule (#2114)
  • ⚠️ eslint-plugin: prefer-standalone recognizes that standalone is the default (#2096)
  • ⚠️ eslint-plugin: remove deprecated prefer-standalone-component rule (#2112)

❤️ Thank You

  • Daniel Kimmich @json-derulo
  • Dave @reduckted
  • James Henry @JamesHenry
  • JamesHenry @JamesHenry
  • Leosvel Pérez Espinosa @leosvelperez

18.4.3 (2024-11-29)

🩹 Fixes

  • yarn pnp issues (#2143)
  • update dependency @angular/compiler to v18.2.13 (#2139)
  • update typescript-eslint packages to v8.16.0 (#2135)

❤️ Thank You

  • James Henry @JamesHenry

18.4.2 (2024-11-23)

🩹 Fixes

  • update dependency eslint-scope to v8.2.0 (#2106)
  • angular-eslint: allow using angular-eslint with ng add and ng update (#2134)
  • eslint-plugin: handle output() and input() functions in various rules (#2098)
  • eslint-plugin: fix placement of lifecycle interface for subclasses (#1965)

❤️ Thank You

  • Aleksandr Martirosyan
  • Dave @reduckted
  • James Henry @JamesHenry

18.4.1 (2024-11-18)

🩹 Fixes

  • update dependency ignore to v6 (#2047)
  • update dependency @angular/compiler to v18.2.12 (#2090)

18.4.0 (2024-10-21)

🚀 Features

  • support ESM configs and .cjs and .mjs extensions (#2068)

🩹 Fixes

  • update dependency aria-query to v5.3.2 (#2053)
  • update dependency @angular/compiler to v18.2.8 (#2049)
  • update dependency eslint-scope to v8.1.0 (#2075)
  • update typescript-eslint packages to v8.10.0 (#2046)
  • update dependency eslint to v9.13.0, support noConfigLookup (#2045)
  • eslint-plugin: update list of native events (#1881)
  • template-parser: traverse ng-content fallback content (#2031)

❤️ Thank You

  • Dementii K @demkalkov
  • James Henry @JamesHenry
  • Matt Lewis @mattlewis92

18.3.1 (2024-09-11)

🩹 Fixes

  • update dependency eslint to v9.9.1 (#2008)
  • update dependency @angular/compiler to v18.2.1 (#2006)
  • update typescript-eslint packages to v8.2.0 (#2001)
  • template-parser: visit receiver of Call expression (#2015)

❤️ Thank You

  • James Henry @JamesHenry
  • Paweł Maniecki @P4

18.3.0 (2024-08-13)

🚀 Features

  • eslint-plugin: new rule runtime-localize (#1898)

🩹 Fixes

  • update dependency eslint to v9.9.0 (#1976)
  • update dependency @angular/compiler to v18.1.4 (#1973)
  • update dependency ignore to v5.3.2 (#1979)
  • update typescript-eslint packages to v8.1.0 (#1982)
  • eslint-plugin-template: [interactive-supports-focus] allowList with form as default option to support event bubbling (#1922)
  • eslint-plugin-template: [prefer-self-closing-tags] fix ng-content with rich default content (#1971)
  • prefer-self-closing-tags: handle both forward and backward slash (#1967)

❤️ Thank You

  • Daniel Kimmich @json-derulo
  • James Henry @JamesHenry
  • m-akinc @m-akinc
  • Sandi Barr @sandikbarr
  • Simon

18.2.0 (2024-07-31)

🚀 Features

  • update typescript-eslint to v8 stable, eslint v9.8.0 (#1956)

Run ng update @angular-eslint/schematics to automatically update your v8 prerelease dependencies of typescript-eslint to v8.0.0, as well as ESLint to v9.8.0 (if you are still using typescript-eslint v7 and ESLint v8 you will be unaffected by this migration).

🩹 Fixes

  • update dependency axobject-query to v4.1.0 (#1936)
  • update dependency semver to v7.6.3 (#1933)
  • update dependency eslint-scope to v8.0.2 (#1932)
  • update dependency @angular/compiler to v18.1.3 (#1954)
  • update nrwl monorepo to v19.5.4 (#1950)
  • eslint-plugin: [prefer-standalone] ignore empty Directive decorators (#1949)
  • eslint-plugin-template: add meta to preprocessor to resolve eslint cache error (#1924)

❤️ Thank You

  • James Henry @JamesHenry
  • kwiateusz @kwiateusz
  • Paweł Maniecki @P4

18.1.0 (2024-07-01)

🚀 Features

  • eslint-plugin: [prefer-output-readonly] support output() function (#1876)
  • eslint-plugin: [no-call-expression] add allowPrefix and allowSuffix (#1897)

🩹 Fixes

  • update dependency @angular/compiler to v18.0.2 (#1852)
  • update dependency eslint to v9.5.0 (#1886)
  • update dependency eslint to v9.6.0 (#1900)
  • update dependency @angular/compiler to v18.0.5 (#1893)
  • update nrwl monorepo to v19.3.2 (#1902)
  • update typescript-eslint packages to v8.0.0-alpha.38 (#1904)
  • eslint-plugin-template: [prefer-self-closing-tags] always ignore index.html files (#1865)
  • eslint-plugin-template: [prefer-self-closing-tags] support ng-content with fallback content (#1880)
  • test-utils: use configured RuleTester.afterAll over global (#1878)

❤️ Thank You

  • Christian Svensson
  • Daniel Kimmich @json-derulo
  • Dave @reduckted
  • Martijn van der Meij
  • Maximilian Main @MaximilianMain

18.0.1 (2024-05-30)

🩹 Fixes

  • move typescript-eslint packages to peerDeps, consistently allow v7 and v8 (#1856)

As part of the v18 release, support for typescript-eslint v8 prereleases was added. For authors of custom rules that consume the @angular-eslint/utils or new @angular-eslint/test-utils packages, the initial way this was set up with dependencies could cause type conflicts between v7 and v8. To resolve this the @angular-eslint/* packages now depend on @typescript-eslint/* packages via a peerDependency which permits both v7 and v8 prereleases.

❤️ Thank You

  • James Henry @JamesHenry

18.0.0 (2024-05-29)

As always we recommend that you update your existing workspaces by using ng update as we provide some helpful schematics to help migrate your workspaces to the latest and greatest. Running the following will update Angular, the Angular CLI and angular-eslint together:

ng update @angular/core @angular/cli @angular-eslint/schematics

NOTE: There will not be any migration of your setup to ESLint v9 or flat configs for existing workspaces in v18.

The ESLint team are working on auto-migrate tooling which we will leverage in an opt-in conversion generator once it is ready in a v18 minor release and consider full auto-migration in v19 in six months (aligned with Angular major release schedule as always).

If you want to manually migrate your workspace to use ESLint v9, typescript-eslint v8, and flat config you are welcome to and it should be fully supported in v18.

If you are going to attempt this, we strongly recommended creating a fresh Angular v18 workspace and adding angular-eslint to it per the instructions below and then copying the dependencies and configs that it applies into your existing workspace

Here is an example of what the new flat config with angular-eslint v18, typescript-eslint v8, and ESLint v9 looks like:

image


Adding to New Angular Workspaces in v18

There is a decision to be made when adding to new Angular v18 workspaces.

Just as before, if you want to add angular-eslint to a workspace with no existing lint setup, you leverage ng add with the @angular-eslint/schematics package.

The difference is in v18, you have the option of using either:

  • the latest version of ESLint v9, with the latest default so called "flat config" (eslint.config.js) alongside the latest prerelease of typescript-eslint v8 (https://typescript-eslint.io/blog/announcing-typescript-eslint-v8-beta) OR
  • the final stable version of ESLint v8, with the legacy so called "eslintrc" config (.eslintrc.json) and the latest stable version of typescript-eslint v7

The ESLint v9 option is the default scenario if you simply run ng add with no other changes. If you want to signal to angular-eslint that you instead want to go with the ESLint v8 option, simply add an eslint v8 (the exact version does not matter, it just needs to be less than 9) devDependency in your package.json before running the ng add. That's it - you don't even need to install the eslint package, it just needs to be listed there.

E.g. image

Here are example "after" root package.json files from the two scenarios:

1. No eslint devDependency specified before running ng add, use the default ESLint v9 setup. This will use the new angular-eslint and typescript-eslint core packages, so you will see much fewer individual devDependencies added:

image

2. eslint v8 devDependency is specified before running ng-add. Use ESlint 8.57.0 and the traditional @typescript-eslint/ and @angular-eslint/ packages.

image


🚀 Features

  • ⚠️ update to Angular v18, drop support for Angular v17 (#1830)
  • ⚠️ deprecate no-host-metadata-property rule and remove from recommended config of @angular-eslint/eslint-plugin (#1830)
  • ⚠️ drop support for ESLint v7 (#1830)
  • ⚠️ migrate test related utils out of @angular-eslint/utils into new @angular-eslint/test-utils package (#1830)
  • add support for ESLint v9 (maintaining support for the final version of ESLint v8 - 8.57.0). (#1830)
  • add the new angular-eslint core package for use in ESLint v9 workspaces (#1830)
  • generate new configs as the new default flat config with ESLint v9 and typescript-eslint v8 prereleases (#1830)

🩹 Fixes

  • update links from angular.io to angular.dev (#1830)

⚠️ Breaking Changes

  • ⚠️ update to Angular v18, drop support for Angular v17 (#1830)
  • ⚠️ deprecate no-host-metadata-property rule and remove from recommended config of @angular-eslint/eslint-plugin (#1830)
  • ⚠️ drop support for ESLint v7 (#1830)
  • ⚠️ migrate test related utils out of @angular-eslint/utils into new @angular-eslint/test-utils package (#1830)

❤️ Thank You

  • James Henry @JamesHenry

17.5.2 (2024-05-28)

🩹 Fixes

  • update typescript-eslint packages to v7.11.0 (#1846)

17.5.1 (2024-05-23)

🩹 Fixes

  • update dependency @angular/compiler to v17.3.10 (#1835)

17.5.0 (2024-05-22)

🚀 Features

  • eslint-plugin: [use-lifecycle-interface] add fixer for the rule (#1691)
  • eslint-plugin-template: [i18n] add allowMarkupInContent option (#1795)

🩹 Fixes

  • update dependency @angular/compiler to v17.3.9 (#1821)
  • update typescript-eslint packages to v7.10.0 (#1822)
  • eslint-plugin: [no-input-rename] incorrectly triggers on input transforms (#1809)
  • eslint-plugin-template: [label-has-associated-control] check id's in the for attribute of a label for existence (#1761)

❤️ Thank You

  • Auke Bruinsma
  • Jonathan Kolberg @bulldog98
  • m-akinc @m-akinc
  • Mateusz

17.4.1 (2024-05-15)

🩹 Fixes

  • update dependency @angular/compiler to v17.3.8 (#1797)
  • schematics: ignore nx cache (#1816)

❤️ Thank You

  • James Henry @JamesHenry

17.4.0 (2024-05-07)

🚀 Features

  • eslint-plugin: [no-duplicates-in-metadata-arrays] new rule (#1779)

🩹 Fixes

  • update dependency @angular/compiler to v17.3.4 (#1750)
  • update dependency eslint-scope to v8.0.1 (#1762)
  • update dependency @angular/compiler to v17.3.6 (#1775)
  • update typescript-eslint packages to v7.8.0 (#1786)
  • eslint-plugin: [sort-ngmodule-metadata-arrays] deprecate rule (#1781)
  • eslint-plugin-template: [attributes-order] calculate valueless structural directive start/end positions correctly (#1726)
  • schematics: update schema.json with latest from Angular (a5adbfc)

❤️ Thank You

  • “JamesHenry” @JamesHenry
  • Adrian Baran @abaran30
  • Brad Kovach @bradkovach

17.3.0 (2024-03-15)

🚀 Features

  • eslint-plugin: add consistent-component-styles rule (#1710)
  • eslint-plugin: add prefer-standalone rule for checking all components, directives and pipes (#1627)

🩹 Fixes

  • update dependency tmp to v0.2.3 (#1734)
  • migrate to nx 18 (#1732)
  • update dependency ignore to v5.3.1 (#1733)
  • update dependency eslint to v8.57.0 (#1739)
  • update typescript-eslint packages to v7 (major) (#1742)
  • update dependency @angular/compiler to v17.3.0 (#1713)
  • output declaration files in all packages (#1724)
  • eslint-plugin-template: [eqeqeq] calculate offset to find true absolute source span (#1709)

❤️ Thank You

  • Christian Svensson
  • Dave @reduckted
  • James Henry @JamesHenry
  • Joey Jacobs @joeyj
  • Luis Estevez @estevezluis

17.2.1 (2024-01-20)

🩹 Fixes

  • update typescript-eslint packages to v6.18.1 (#1685)
  • update typescript-eslint packages to v6.19.0 (#1703)
  • update dependency @angular/compiler to v17.1.0 (#1689)
  • eslint-plugin-template: [no-call-expression] False negative with the new control flow syntax (#1677)
  • eslint-plugin-template: handle i18n tags on structural direcives (#1662)

❤️ Thank You

  • Adam Reisinger @Res42
  • Matt Lewis @mattlewis92

17.2.0 (2024-01-06)

🚀 Features

  • eslint-plugin: [no-async-lifecycle-method] add rule (#1643)

🩹 Fixes

  • update dependency eslint to v8.56.0 (#1657)
  • update typescript-eslint packages to v6.18.0 (#1682)
  • update dependency @angular/compiler to v17.0.8 (#1618)
  • update dependency eslint-scope to v8 (#1683)
  • eslint-plugin-template: fix control flow syntax with i18n rule (#1656)

❤️ Thank You

  • Matt Lewis @mattlewis92
  • Steven Chim @chimurai

17.1.1

🩹 Fixes

  • update nrwl monorepo to v17.1.3 (#1632)
  • update typescript-eslint packages to v6.12.0 (#1631)
  • update dependency ignore to v5.3.0 (#1622)
  • update dependency eslint to v8.54.0 (#1625)
  • update typescript-eslint packages to v6.13.0 (#1644)
  • update typescript-eslint packages to v6.13.1 (#1649)
  • eslint-plugin: fix max inline declarations rule for styles string (#1630)
  • eslint-plugin-template: [prefer-ngsrc] Do not prefer ngsrc for base64-encoded strings (#1628)
  • eslint-plugin-template: [prefer-control-flow] prevent error when… (#1634)

❤️ Thank You

  • Christian Svensson
  • Daniel Kimmich @json-derulo
  • Luis Estevez @estevezluis

17.1.0

🚀 Features

  • eslint-plugin-template: [no-negated-async] values used with the async pipe are not negated (#1606)
  • eslint-plugin-template: [prefer-control-flow] add rule (#1600)

🩹 Fixes

  • update nrwl monorepo to v17.1.2 (#1617)
  • update dependency @angular/compiler to v17.0.2 (#1607)
  • update typescript-eslint packages to v6.11.0 (#1612)
  • eslint-plugin-template: [attributes-order] fixes for structural directives and i18n ordering (#1602)

❤️ Thank You

  • Adrian Baran @abaran30
  • Daniel Kimmich @json-derulo
  • Phil McCloghry-Laing @pmccloghrylaing

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

17.0.1 (2023-11-09)

Bug Fixes

17.0.0 (2023-11-08)

As always we recommend that you update your existing workspaces by using ng update as we provide some helpful schematics to help migrate your workspaces to the latest and greatest. Running the following will update Angular, the Angular CLI and angular-eslint together:

ng update @angular/core @angular/cli @angular-eslint/schematics

Bug Fixes

  • no declarations for eslint plugins (2498238)

Features

  • eslint-plugin-template: [prefer-self-closing-tags] consider ng-content and ng-template elements (#1573) (8e97d20)

BREAKING CHANGES

  • As always, the major version primarily communicates the alignment with Angular's major version. Only Angular 17 is supported by angular-eslint 17.
  • Your Node version must now be 18.13.0 or higher. Node 16 support has been dropped in alignment with Angular 17, as Node 16 is EOL.
  • typescript-eslint v6 is now used by angular-eslint, and we will migrate existing workspaces when you use ng update. You may notice that some rule reports or configs have changed as a result, and we will not be able to automatically migrate all differences. Please see the typescript-eslint blog post about v6 for full information about the changes: https://typescript-eslint.io/blog/announcing-typescript-eslint-v6

16.3.1 (2023-11-08)

Note: Version bump only for package @angular-eslint/angular-eslint

16.3.0 (2023-11-08)

Bug Fixes

Features

  • eslint-plugin-template: allow alias option in [use-track-by-function] (#1497) (354d394)

16.2.0 (2023-09-17)

Bug Fixes

  • eslint-plugin-template: [prefer-self-closing-tags] improve code style of fixer result (#1520) (6a86f19)
  • eslint-plugin-template: fix fixer of inline templates (#1472) (470e12b)
  • eslint-plugin: [use-component-selector] applies to template literals (#1468) (cbe60d3)
  • update dependency @angular/compiler to v16.2.5 (#1517) (fcfe7cc)
  • update dependency axobject-query to v3.2.1 (#1524) (bb171d4)
  • update dependency eslint to v8.49.0 (#1511) (abeb9f5)

Features

  • eslint-plugin-template: [prefer-ngsrc] add rule (#1477) (0cfbc80)
  • eslint-plugin: [sort-lifecycle-methods] add rule (#1320) (47f7975)

16.1.2 (2023-09-04)

Bug Fixes

  • angular-eslint: ignore hostDirectives for no-output-rename and no-outputs-metadata-property (#1466) (208bf25)
  • update dependency @angular/compiler to v16.2.3 (#1458) (2b895a8)

16.1.1 (2023-08-20)

Bug Fixes

  • eslint-plugin-template: [attributes-order] Handle explicit ng-template usage (#1465) (7d1f592)
  • eslint-plugin-template: update links to Angular i18n docs (#1476) (9633058)
  • eslint-plugin: export require-localize-metadata rule (#1469) (e3dc936)
  • update dependency eslint to v8.45.0 (#1461) (9c95032)
  • update dependency eslint to v8.47.0 (#1489) (047338a)
  • update dependency eslint-scope to v7.2.2 (#1460) (0bb6dca)

16.1.0 (2023-07-12)

Bug Fixes

  • eslint-plugin-template: [attributes-order] fixes for structural directives and "dotted" names (#1448) (90c0e91)
  • eslint-plugin: [valid-aria] tristate "mixed" value not handled (#1398) (e7c762a)
  • update dependency @angular/compiler to v16.1.2 (#1411) (cd1622e)
  • update dependency @angular/compiler to v16.1.4 (#1439) (a239094)
  • update dependency aria-query to v5.3.0 (#1441) (4b3a9dd)
  • update dependency eslint to v8.41.0 (#1394) (02b34fb)
  • update dependency eslint to v8.44.0 (#1415) (8735f7b)
  • update nrwl monorepo to v16.5.1 (#1443) (15bff48)
  • update typescript-eslint packages to v5.59.8 (#1393) (5b0e87e)
  • update typescript-eslint packages to v5.59.9 (#1420) (fdd817f)
  • update typescript-eslint packages to v5.62.0 (#1444) (4affbf4)

Features

  • eslint-plugin-template: [no-duplicate-attributes] add allowStylePrecedenceDuplicates option (#1407) (6f69af8)
  • eslint-plugin-template: [self-closing-tags] add rule (#1322) (6d26c59)
  • eslint-plugin: add prefer-standalone-component rule (#1317) (94e4d4e)

16.0.3 (2023-05-29)

Bug Fixes

16.0.2 (2023-05-17)

Bug Fixes

16.0.1 (2023-05-03)

Bug Fixes

  • schematics: ensure placeholder schema for convert-tslint-to-eslint is copied to dist (3c6f377)

16.0.0 (2023-05-03)

As always we recommend that you update your existing workspaces by using ng update as we provide some helpful schematics to help migrate your workspaces to the latest and greatest. Running the following will update Angular, the Angular CLI and angular-eslint together:

ng update @angular/core @angular/cli @angular-eslint/schematics

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
  • 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
  • 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
  • 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.

15.2.1 (2023-02-10)

Bug Fixes

  • eslint-plugin-template: [i18n] handle ng-template properly (#1257) (7b0877d)
  • update dependency @angular/compiler to v15.1.4 (#1282) (d1b3d59)
  • update dependency eslint to v8.32.0 (#1276) (15d2e23)
  • update dependency eslint to v8.33.0 (#1292) (bd82b42)
  • update typescript-eslint packages to v5.48.2 (#1278) (69d56a7)

15.2.0 (2023-01-14)

Bug Fixes

  • eslint-plugin: [component-selector] enhance check for prefix and kebab-case (#1250) (16827e4)
  • eslint-plugin: [no-inputs-metadata-property] do not report on directive composition API (#1248) (539cf9f)
  • update dependency @angular/compiler to v15.0.2 (#1245) (061601f)
  • update dependency @angular/compiler to v15.1.0 (#1252) (4295c59)
  • update dependency eslint to v8.29.0 (#1246) (10c14d2)
  • update dependency eslint to v8.31.0 (#1262) (db89c85)
  • update dependency ignore to v5.2.1 (#1237) (609e06b)
  • update dependency ignore to v5.2.4 (#1263) (a220e0c)
  • update typescript-eslint packages to v5.45.1 (#1239) (abb7f79)
  • update typescript-eslint packages to v5.48.1 (#1255) (11151d1)
  • utils: use test case filename when specified (#1259) (37bfd14)
  • utils: use tsconfigRootDir as root dir when specified (#1260) (19fe26c)

Features

  • eslint-plugin-template: [i18n] option to require i18n metadata meaning (#1234) (4ef0290)
  • eslint-plugin-template: [no-interpolation-in-attributes] new rule added (#1242) (977cb3a)
  • eslint-plugin: [require-localize-metadata] option to require meaning (#1235) (b870123)

15.1.0 (2022-11-24)

Bug Fixes

  • eslint-plugin-template: [accessibility-valid-aria] use Number() to parse numeric values (#1218) (6fe40d6)
  • eslint-plugin-template: [i18n] allow more attributes by default (#1220) (4232b1c)
  • eslint-plugin: [no-input-rename] do not report on directive composition API (#1231) (119fba7)
  • update dependency @angular/compiler to v15.0.1 (#1223) (7b7bd76)
  • update typescript-eslint packages to v5.44.0 (#1222) (5750e3a)

Features

  • eslint-plugin-template: [no-call-expression] add allowList option (#1217) (a69c809)

15.0.0 (2022-11-20)

As always we recommend that you update your existing workspaces by using ng update as we provide some helpful schematics to help migrate your workspaces to the latest and greatest. Running the following will update Angular, the Angular CLI and angular-eslint together:

ng update @angular/core @angular/cli @angular-eslint/schematics

Bug Fixes

  • schematics: ensure scoped project names have correct eslint extends (7b3f736)

Features

  • bump minimum supported eslint version to 7.20.0 (56ad69f), closes #662
  • eslint-plugin: remove no-conflicting-lifecycle from recommended config (19dd177), closes #502
  • fast linting by default, set eslint and typescript-eslint recommended (#1212) (1a53ef9), closes #1174
  • schematics: ng update migration to preserve v14 parserOptions.project for existing workspaces (1d45914)

BREAKING CHANGES

  • Your installed version of ESLint must be version 7.20.0 or later (naturally we recommend the latest v8 of ESLint if possible)
  • eslint-plugin: no-conflicting-lifecycle is no longer included as part of the recommended config and if you wish to continue using it you will need to enable it yourself in your eslint config rules
  • New projects will not include parserOptions.project configuration in .eslintrc.json files by default, see the new guide here ./docs/RULES_REQUIRING_TYPE_INFORMATION.md

14.4.0 (2022-11-20)

Features

14.3.1 (2022-11-20)

Bug Fixes

  • no-input-rename: allow input aliases that match the directive name applied to an element (#1207) (aff3344)
  • update dependency eslint to v8.28.0 (#1210) (c671e74)

14.3.0 (2022-11-17)

Bug Fixes

  • update dependency @angular/compiler to v14.2.11 (#1202) (6c1eb81)

Features

  • eslint-plugin-template: [accessibility-elements-content] add allowList option (#1201) (3877f43)
  • eslint-plugin-template: [no-inline-styles] add rule (#1162) (7e1aadf)

14.2.0 (2022-11-15)

Bug Fixes

  • update dependency @angular/compiler to v14.2.10 (#1165) (bb4bfe5)
  • update dependency @angular/compiler to v14.2.3 (#1143) (4eb3e74)
  • update dependency aria-query to v5.1.3 (#1183) (7c5b299)
  • update dependency axobject-query to v3.1.1 (#1184) (dcfd43d)
  • update dependency eslint to v8.27.0 (#1189) (d2ae95a)
  • update dependency eslint-scope to v7 (#1156) (05bd9e6)
  • update typescript-eslint packages to v5.38.1 (#1152) (8f6d0ef)
  • update typescript-eslint packages to v5.43.0 (#1190) (2a4716a)

Features

  • eslint-plugin-template: [accessibility-interactive-supports-focus] add rule (#1134) (d99d8c1)
  • eslint-plugin-template: [accessibility-role-has-required-aria] add rule (#1100) (f684df0)
  • eslint-plugin-template: [attributes-order] add rule with fixer (#1066) (4c789c7)
  • eslint-plugin-template: [no-duplicate-attributes] Add option to ignore properties (#1104) (018d390)
  • update dependency eslint to v8.24.0 (#1148) (5f30b2d)
  • update typescript-eslint packages to v5.38.0 (#1140) (85b4b47)

14.1.2 (2022-09-21)

Bug Fixes

  • builder: remove nrwl/devkit from builder implementation (#1142) (9d5a7fc)

14.1.1 (2022-09-18)

Bug Fixes

  • eslint-plugin-template: [click-events-have-key-events]: handle additional outputs (#1101) (c608cdb)
  • eslint-plugin: [sort-ngmodule-metadata-arrays]: add intl support (#1099) (30d133b)

14.1.0 (2022-09-18)

Features

14.0.4 (2022-09-08)

Bug Fixes

  • schematics: prefer sourceRoot if available for root project (#1114) (36c62c3)
  • support TS 4.8 with Angular 14.2, update dependencies (#1123) (a780b59)

14.0.3 (2022-08-23)

Bug Fixes

  • builder: ensure package works with Angular 14.1.3 (#1112) (b00ef2e)

14.0.2 (2022-07-09)

Bug Fixes

14.0.1 (2022-07-08)

Bug Fixes

14.0.0 (2022-06-23)

As always we recommend that you update your existing workspaces by using ng update as we provide some helpful schematics to help migrate your workspaces to the latest and greatest. Running the following will update Angular, the Angular CLI and angular-eslint together:

ng update @angular/core @angular/cli @angular-eslint/schematics

BREAKING CHANGES

This is a major version bump and comes with some breaking changes, one of which might possibly impact your ESLint configuration if you are targeting inline HTML templates with a very specific glob pattern because the virtual filename has changed (read on to learn more).

  • update Angular to v14

    • All packages now require the use of Angular CLI >= 14.0.0 < 15.0.0
  • dropped support for Node 12 (in alignment with Angular's own version policy)

  • extracted inline HTML templates now contain the original Component filename in their processed virtual filename

    • When ESLint runs on your Component files, if you are using the recommended configuration, it will invoke a processor we have set up to extract the inline HTML templates from your Component declarations. Behind the scenes we give these extracted templates virtual filenames ending in .html so that rules targeting HTML files can also target your inline templates.
    • Before: In v13 the filename looked like this: inline-template-${++i}.component.html, where i was an incrementing integer (in case for example you had multiple Component declarations in the same .ts file.
    • Now: In v14 the filename now looks like this inline-template-${baseFilename}-${++i}.component.html, where i has the same incrementing integer behavior as before, but we now include the base filename within the virtual filename.
      • E.g. if you have a test file in projects/foo/src/app/app.spec.ts which declares a Component with an inline template, the virtual filename generated behind the scene for that template will be inline-template-app.spec.ts-1.component.html.
      • This new behavior allows you to use ESLint overrides to apply different behavior to Component inline templates in different files.

Features

  • update eslint to ^8.18.0 (automatically migrated via ng update)
  • update typescript-eslint to ^5.29.0 (automatically migrated via ng update)
  • update deprecated cli.defaultCollection usage in angular.json to use cli.schematicCollections instead (automatically migrated via ng update)

13.5.0 (2022-06-12)

Features

  • eslint-plugin-template: [button-has-type] add rule (#928) (f19bb30)

13.4.0 (2022-06-11)

Features

  • update typescript-eslint packages to v5.27.1 (#1022) (99e8d4a)

13.3.0 (2022-06-10)

Bug Fixes

  • eslint-plugin-template: [eqeqeq] update suggest message (#1000) (821cb8e)
  • eslint-plugin: [sort-ngmodule-metadata-arrays] do not sort deps property (#1001) (e6d12f2)

Features

  • eslint-plugin-template: [i18n] add requireDescription option (#988) (8f55ba8)
  • update dependency eslint to v8.17.0 (#979) (7cabac0)

13.2.1 (2022-04-14)

Bug Fixes

  • eslint-plugin-template: false positive conditional complexity in BoundAttribute > Interpolation (#986) (c3f3120)
  • template-parser: suppress parse errors by default, add suppressParseErrors parserOption (#987) (417bee6)

13.2.0 (2022-04-03)

Bug Fixes

  • schematics: support more permutations of ng-add (#970) (0bf549b)

Features

  • eslint-plugin-template: add require-localize-metadata rule (#844) (ca1edf0)
  • parser: propagate parse errors from angular compiler (#969) (ab9b496)

13.1.0 (2022-02-13)

Bug Fixes

  • eslint-plugin-template: [i18n] do not throw when compiler returns null i18n description (#892) (d349149)
  • rule docs links in create-eslint-rule utils (#907) (94f6e21)
  • update dependency ignore to v5.2.0 (#913) (5480102)

Features

  • eslint-plugin-template: [i18n] add checkDuplicateId option (#868) (edaf46f)
  • update angular/compiler to v13.2.2 (#834) (9847978)

13.0.1 (2021-11-19)

Bug Fixes

  • schematics: auto update eslint-plugin-import as part of v13 ng update (#836) (705e83b)

13.0.0 (2021-11-18)

Whilst this is a major release of the packages, in this case the major version change is primarily there to signify alignment with v13 of Angular.

You should look to migrate to v13 of all Angular packages, as well as v8 of eslint and v5 of typescript-eslint.

All of this will be handled for you automatically if you leverage the ng update schematics provided by @angular-eslint. You can simply include @angular-eslint/schematics in your ng update command alongside @angular/cli and @angular/core, for example:

npx ng update @angular/cli @angular/core @angular-eslint/schematics

Features

12.7.0 (2021-11-18)

Bug Fixes

Features

  • builder: expose nx executor without ng-compat layer (#808) (b2cd5d1)
  • i18n: option to require description for i18n metadata (#804) (7d072e2)
  • schematics: add package group for ng update (#807) (ce2e47d)

12.6.1 (2021-10-26)

Bug Fixes

12.6.0 (2021-10-25)

Bug Fixes

  • eslint-plugin: [sort-ngmodule-metadata-arrays] remove the property restriction (#694) (440f6dc)
  • eslint-plugin: [sort-ngmodule-metadata-arrays] report the correct node (#693) (886db08)
  • eslint-plugin: more appropriate language for no-attribute-decorator (#696) (4dde82c)
  • eslint-plugin-template: [i18n] ignore empty strings and non-texts within BoundText by default (#683) (4075643)

Features

  • bundled-angular-compiler: create own bundle for @angular/compiler (#720) (0c42299)

12.5.0 (2021-09-20)

Bug Fixes

  • eslint-plugin-template: [mouse-events-have-key-events] ignore custom components (#680) (f65874b)
  • eslint-plugin-template: support escape chars in inline templates (#691) (8b89ec7)

Features

  • utils: publicly expose utils related to eslint-plugin (#676) (07711f1)

12.4.1 (2021-09-09)

Bug Fixes

  • utils: add missing filename option for invalid case utils (#674) (80b72b3)

12.4.0 (2021-09-09)

Bug Fixes

  • eslint-plugin: [no-empty-lifecycle-method] incorrect suggestions and correct reports (#606) (a446e8f)
  • eslint-plugin: [sort-ngmodule-metadata-arrays] handle literal metadata and computed properties (#667) (f993069)
  • eslint-plugin: properly handle computed literals for some rules (#600) (fbd6ff7)
  • eslint-plugin-template: [i18n] fixes some incorrect reports (#665) (a011b9d)
  • eslint-plugin-template: [no-call-expression]: FunctionCalls not being reported (#601) (5552b13)
  • eslint-plugin-template: include more checks for isHiddenFromScreenReader (#545) (db2bc05)

Features

  • eslint-plugin: [prefer-on-push-component-change-detection] add suggestion (#666) (3723c4c)
  • eslint-plugin: [use-injectable-provided-in] add suggestion (#594) (bdef8c7)
  • utils: make package public (#673) (0386082)

12.3.1 (2021-07-15)

Bug Fixes

  • eslint-plugin: handle literal outputs properly for [-output-] rules (#595) (8621a62)
  • template-parser: correct typings for cjs (#597) (bb60224)

12.3.0 (2021-07-13)

Bug Fixes

  • eslint-plugin: [no-input-prefix] handle alias and inputs metadata property (#582) (675ee11)
  • eslint-plugin: [no-input-rename] handle alias and inputs metadata property (#583) (2883e18)
  • eslint-plugin: [use-component-view-encapsulation] handle literal encapsulation properly (#586) (3a9b7f4)
  • eslint-plugin: [use-pipe-transform-interface] handle type imports properly in fix (#592) (ac3fb12)

Features

  • builder: add noEslintrc option (#588) (4b150bf)
  • builder: add resolvePluginsRelativeTo option (#590) (3bea308)
  • builder: add rulesdir option (#589) (ff9557d)
  • builder: added outputFile option (#587) (420734b)
  • eslint-plugin: [component-selector] handle shadow dom components properly (#559) (ecbe684)
  • eslint-plugin: [no-pipe-impure] add suggestion (#585) (149bf2f)
  • schematics: better support @angular/cli 12.1 (#591) (c5da07b)

12.2.2 (2021-07-10)

Bug Fixes

  • eslint-plugin: [no-output-on-prefix] handle getters and outputs metadata property (#566) (5884482)
  • eslint-plugin: [no-output-rename] handle getters and outputs metadata property (#568) (c803ffd)

12.2.1 (2021-07-10)

Bug Fixes

  • eslint-plugin: [no-output-native] handle getters and outputs metadata property (#567) (22b378d)
  • eslint-plugin: [no-output-on-prefix] correct false positives (#525) (3a66274)

12.2.0 (2021-06-20)

Bug Fixes

  • eslint-plugin: [no-output-native] correct false positives (#524) (215abec)
  • eslint-plugin-template: [accessibility-table-scope] ignore custom elements (#550) (53eb56d)
  • eslint-plugin-template: [accessibility-valid-aria] ignore custom elements (#552) (f6466ec)
  • eslint-plugin-template: [no-autofocus] ignore custom elements (#540) (366d9df)
  • eslint-plugin-template: [no-positive-tabindex] ignore custom elements (#551) (5e33995)

Features

  • builder: add cacheStrategy option (#520) (427a9f5)
  • eslint-plugin: [use-component-view-encapsulation] add suggestion (#501) (ea9e98d)
  • eslint-plugin-template: [no-positive-tabindex] add suggestion (#541) (0582c2a)

12.1.0 (2021-05-30)

Bug Fixes

  • eslint-plugin: [no-host-metadata-property] correct false positive with allowStatic option (#482) (89926d8)
  • eslint-plugin: [no-output-on-prefix] not reporting failures on alias (#471) (f9ba372)
  • eslint-plugin: [relative-url-prefix] valid relative urls being reported (#456) (2247394)
  • eslint-plugin-template: [18n] ignore checkAttributes properly (#467) (20e54d7)
  • eslint-plugin-template: [eqeqeq] change fix to suggest (#465) (a497fde)
  • eslint-plugin-template: [no-negated-async] ignore double-bang (#450) (9d06488)
  • schematics: skip config for tsconfig.e2e.json when no e2e project is present (#484) (2673e59)
  • template-parser: generate correct index.d.ts when building (#480) (e150044)
  • utils: support passing data and suggestions individually for each error (#491) (70b01bd)

Features

  • eslint-plugin: [no-empty-lifecycle-method] add suggestion (#463) (1d1a329)
  • eslint-plugin: [no-host-metadata-property] add option to allow static values (#478) (d64c832)
  • eslint-plugin: [no-input-rename] add option to allow some inputs (#475) (9c861dc)
  • eslint-plugin: [prefer-output-readonly] add suggestion (#459) (f3ff789)
  • eslint-plugin: [sort-ngmodule-metadata-arrays] add fixer (#493) (32fae47)
  • eslint-plugin-template: [accessibility-table-scope] add fixer (#490) (f0c4cea)
  • eslint-plugin-template: [accessibility-valid-aria] add suggestion (#489) (678e1b5)
  • eslint-plugin-template: [no-any] add suggestion (#486) (720e869)
  • eslint-plugin-template: [no-autofocus] add fixer (#485) (9450b7d)
  • eslint-plugin-template: [no-distracting-elements] add fixer (#488) (9cefe67)
  • eslint-plugin-template: [no-duplicate-attributes] add suggestion (#495) (62cadcd)
  • eslint-plugin-template: [no-negated-async] add suggestion (#487) (0b3f9eb)
  • schematics: on ng add include a lint command if none exists (#481) (ae49af4)
  • utils: add support for suggestions (#458) (0ea02ae)

12.0.0 (2021-05-13)

Bug Fixes

  • template-parser: add missing Conditional and its keys to VisitorKeys (#445) (5ad0f1a)
  • eslint-plugin-template: no-negated-async no longer performs equality checks (#399)

Features

BREAKING CHANGES

  • update to angular v12 (c80008d)

    • All packages now require the use of Angular CLI >= 12.0.0 < 13
  • eslint-plugin-template: no-negated-async no longer performs equality checks (#399)

    • You should add the new @angular-eslint/template/eqeqeq rule to your config if you want to continue with the same functionality around equality checks. This will be applied for you by ng update automatically.

4.3.0 (2021-05-12)

Features

  • eslint-plugin-template: add rule accessibility-label-has-associated-control (#392) (0851f3e)

4.2.1 (2021-05-12)

Bug Fixes

  • eslint-plugin-template: no-negated-async message tweak (#427) (08a8330)

4.2.0 (2021-04-28)

Features

  • schematics: add add-eslint-to-project schematic (#426) (7ae557d)

4.1.0 (2021-04-28)

Bug Fixes

  • schematics: support workspaces which use targets alias (#424) (da6bcf7)

Features

  • schematics: dynamically install tslint-to-eslint-config as needed (#425) (27ca474)

4.0.0 (2021-04-18)

We have provided automated migrations for you to move to v4.

All you need to do is run the update schematics for @angular-eslint:

npx ng update @angular-eslint/schematics

NOTE: For this release, there are no automated migrations to be run, other than automatically updating the version number of your other @angular-eslint packages.

BREAKING CHANGES

  • Passing --collection=@angular-eslint/schematics to ng new is no longer supported:

    • If you attempt to do it you will get a clear error with instructions on what to do instead.
    • This means we have one consistent way to add @angular-eslint to a workspace - run ng add @angular-eslint/schematics - regardless of whether that workspace is brand new or has existed for a while.
  • We have introduced two new options to the convert-tslint-to-eslint schematic:

    • --remove-tslint-if-no-more-tslint-targets so that we remove TSLint and Codelyzer from the workspace automatically if we detect you have no TSLint usage remaining (true by default).
    • --ignore-existing-tslint-config so that we can jump straight to the up to date recommended ESLint setup, without converting the previous Angular CLI TSLint setup, which is unnecessary for brand new projects (false by default).

Features

  • schematics: options for convert-tslint-to-eslint (#419) (18fd863)

3.0.1 (2021-04-18)

Bug Fixes

  • eslint-plugin: correctly expose recommended-extra config (#418) (f727d8c)

3.0.0 (2021-04-17)

PR #388 (f92b184)

We have provided automated migrations for you to move to v3.

All you need to do is run the update schematics for @angular-eslint:

npx ng update @angular-eslint/schematics

BREAKING CHANGES

  • The recommended configs from @angular-eslint/eslin-plugin now only configures rules directly from that plugin. This provides an overall more intuitive experience when stacking the recommended config with other plugins from the ecosystem. If you wish to continue having the same experience (with mixed @angular-eslint and @typescript-eslint rules in the configs you inherit from you can add the new recommended--extra config to your ESLint extends in the relevant config.

E.g. extract from .eslintrc.json

  "extends": [
    "plugin:@angular-eslint/recommended",
+   "plugin:@angular-eslint/recommended--extra",
  ],
  • Within the builder, linting now always runs relative to your workspace root. This should not have any impact on my workflows but is important if you run ng lint from within subdirectories of your workspace.

  • Within the builder, we always make a call to format, even if the lint results are empty. This is important for non-default formatters.

  • We have removed the hard peerDependency on the 3rd party eslint plugins import jsdoc and prefer-arrow. These plugins are only required if you are converted an existing workspace to TSLint and they will still be installed on demand in that scenario.

  • Within the eslint-plugin, the component-max-inline-declarations rule will no longer accept negative values as input. Previously it would silently use the default values in this case. An automated migration is provided for this change as part of the ng update schematics.

2.1.1 (2021-04-17)

Bug Fixes

  • eslint-plugin: sort-ngmodule-metadata-arrays reporting false positives (#408) (149152a)
  • eslint-plugin: directive-class-suffix reporting selectorless directives (#394) (42d4e5d)
  • eslint-plugin-template: [i18n] remove unsafe fix (#411) (3246b8a)

2.1.0 (2021-04-11)

Bug Fixes

  • builder: expose maxWarnings option (#402) (76f5ba4)
  • eslint-plugin: no-call-expression incorrect reports for conditionals (#390) (fa9cc73)
  • eslint-plugin-template: accessibility-elements-content not allowing some attributes/inputs (#397) (ffedaa2)
  • eslint-plugin-template: i18n ignoreTags not being ignored properly (#387) (985f6c2)
  • eslint-plugin-template: i18n reporting when a parent element already contains i18n id (#398) (c937a3f)

Features

  • eslint-plugin: add rule sort-ngmodule-metadata-arrays (#386) (935afdd)
  • template-parser: support eslint-disable comments in HTML templates (#405) (5dd9578)

2.0.2 (2021-03-16)

Bug Fixes

  • builder: printInfo should not be taken into account for report (#376) (d7c6aa4)

2.0.1 (2021-03-14)

Bug Fixes

  • eslint-plugin-template: conditional-complexity error from bundling (#373) (f466c01)

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

1.2.0 (2021-02-06)

Bug Fixes

  • eslint-plugin: component-max-inline-declarations animations not being checked properly (#313) (61a2a0f)
  • eslint-plugin: no-lifecycle-call invalid super calls not being reported (#314) (c44cd5d)
  • eslint-plugin-template: accessibility-valid-aria not reporting i… (#278) (391980f)

Features

  • eslint-plugin: add fixer for use-pipe-transform-interface (#260) (e3f4db6)
  • eslint-plugin-template: add no duplicate attributes rule (#302) (c387de5), closes #293

1.1.0 (2021-01-14)

Bug Fixes

  • eslint-plugin: handle DoBootstrap correctly in lifecycle rules (#243) (5010b3f)
  • eslint-plugin-template: conditional-complexity not reporting all cases (#279) (a4fd077)

Features

  • eslint-plugin-template: accessibility-label-for (#268) (49ab76a)