Monorepo for all the tooling related to using ESLint with Angular
MIT License
Bot releases are hidden (Show)
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).
Published by JamesHenry 4 months ago
Published by JamesHenry 5 months ago
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.
Published by JamesHenry 5 months ago
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:
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:
eslint.config.js
) alongside the latest prerelease of typescript-eslint
v8 (https://typescript-eslint.io/blog/announcing-typescript-eslint-v8-beta).eslintrc.json
) and the latest stable version of typescript-eslint
v7The 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.
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:
2. eslint
v8 devDependency is specified before running ng-add
. Use ESlint 8.57.0
and the traditional @typescript-eslint/
and @angular-eslint/
packages.
@angular-eslint/eslint-plugin
(#1830)@angular-eslint/utils
into new @angular-eslint/test-utils
package (#1830)8.57.0
). (#1830)angular-eslint
core package for use in ESLint v9 workspaces (#1830)typescript-eslint
v8 prereleases (#1830)@angular-eslint/eslint-plugin
(#1830)@angular-eslint/utils
into new @angular-eslint/test-utils
package (#1830)Published by JamesHenry 5 months ago
Published by JamesHenry 6 months ago
Published by JamesHenry 7 months ago
Published by JamesHenry 9 months ago
Published by JamesHenry 10 months ago
Published by JamesHenry 11 months ago
Published by JamesHenry 11 months ago
Published by JamesHenry 12 months ago
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
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
Published by JamesHenry 12 months ago
Published by JamesHenry about 1 year ago