-
-
Notifications
You must be signed in to change notification settings - Fork 244
feat!: angular-eslint v18 #1830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 8041c59. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targetsSent with 💌 from NxCloud. |
40a9104
to
8672cb5
Compare
8672cb5
to
76004d6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1830 +/- ##
==========================================
+ Coverage 90.46% 91.62% +1.16%
==========================================
Files 179 179
Lines 3377 3380 +3
Branches 542 547 +5
==========================================
+ Hits 3055 3097 +42
+ Misses 186 144 -42
- Partials 136 139 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…ed, deprecate it (#1839)
…gular-eslint into next-major-release/v18
Thanks! You're a lifesaver! 🙏 |
PS C:\Users\kushal\src\angular\mycanary> cd "C:\Users\kushal\src\angular\mycanary\"; date; yarn; date; yarn run ng build; date; yarn run ng update; date; yarn run ng update @angular/core @angular/cli @angular/cdk @angular/material @angular/localize rxjs; date; Saturday, May 25, 2024 6:22:44 AM yarn install v1.22.21 [1/4] Resolving packages... success Already up-to-date. Done in 0.29s. Saturday, May 25, 2024 6:22:44 AM yarn run v1.22.21 $ ng build ✔ Browser application bundle generation complete. ✔ Copying assets complete. ✔ Index html generation complete. Initial chunk files | Names | Raw size vendor.js | vendor | 4.75 MB | polyfills.js | polyfills | 138.66 kB | main.js | main | 19.85 kB | runtime.js | runtime | 6.34 kB | styles.css | styles | 2.44 kB | | Initial total | 4.91 MB Build at: 2024-05-25T10:22:49.201Z - Hash: 0efaddec27b7259e - Time: 2270ms Done in 4.18s. Saturday, May 25, 2024 6:22:49 AM yarn run v1.22.21 $ ng update Using package manager: yarn Collecting installed dependencies... Found 41 dependencies. We analyzed your package.json, there are some packages to update: Name Version Command to update ------------------------------------------------------------------------------------- @angular/cdk 17.3.10 -> 18.0.0 ng update @angular/cdk @angular/cli 17.3.7 -> 18.0.1 ng update @angular/cli @angular/core 17.3.9 -> 18.0.0 ng update @angular/core @angular/material 17.3.10 -> 18.0.0 ng update @angular/material There might be additional packages which don't provide 'ng update' capabilities that are outdated. You can update the additional packages by running the update command of your package manager. Done in 4.89s. Saturday, May 25, 2024 6:22:54 AM yarn run v1.22.21 $ ng update @angular/core @angular/cli @angular/cdk @angular/material @angular/localize rxjs The installed Angular CLI version is outdated. Installing a temporary Angular CLI versioned 18.0.1 to perform the update. ✔ Packages successfully installed. Using package manager: yarn Collecting installed dependencies... Found 41 dependencies. Fetching dependency metadata from registry... Package "@angular-eslint/schematics" has an incompatible peer dependency to "@angular/cli" (requires ">= 17.0.0 < 18.0.0", would install "18.0.1"). × Migration failed: Incompatible peer dependencies found. Peer dependency warnings when installing dependencies means that those dependencies might not work correctly together. You can use the '--force' option to ignore incompatible peer dependencies and instead address these warnings later. See "C:\Users\kushal\AppData\Local\Temp\ng-0ncWdO\angular-errors.log" for further details. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Saturday, May 25, 2024 6:23:12 AM PS C:\Users\kushal\src\angular\mycanary> see also angular-eslint/angular-eslint#1837 angular-eslint/angular-eslint#1830
…8, unless eslint pinned to v8
I have updated the PR description with guidance on how No more breaking changes are expected at this stage, please try it out using instructions in the description and report any issues with minimal steps to reproduce. The final known TODO is to update the main documentation. Thanks all! |
As you can see this PR was a huge amount of work to add support for ESLint v9 and Flat Config while still maintaining backwards compatibility with ESLint v8 and eslintrc configs. This was done in my personal time at the expense of other things. If you are able to and feel like buying me a coffee or two to support my work, you can find my link here:
https://buymeacoffee.com/jameshenry
Thank you 🙏
As usual, we align our major release with the Angular framework/Angular CLI.
Main highlights/TODO list before merge, which will also be called out in the release notes as part of the stable release:
@angular-eslint/eslint-plugin
8.57.0
).@angular-eslint/utils
into new@angular-eslint/test-utils
packagetypescript-eslint
v8 prereleasesangular-eslint
core package for use in ESLint v9 workspacesUpdating existing Angular CLI workspaces to v18
After you have updated your Angular CLI version, simply run:
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 automigrate tooling which we will leverage in an opt-in conversion generator once it is ready in a v18 minor release and consider full automigration 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 support in v18 (which is how the next section is possible).Here is an example of what the new flat config with
angular-eslint
v18,typescript-eslint
v8, and ESLint v9 looks like: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 leverageng 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 oftypescript-eslint
v8 (https://typescript-eslint.io/blog/announcing-typescript-eslint-v8-beta)OR
.eslintrc.json
) and the latest stable version oftypescript-eslint
v7The ESLint v9 option is the default scenario if you simply run
ng add
with no other changes. If you want to signal toangular-eslint
that you instead want to go with the ESLint v8 option, simply add aneslint
v8 (the exact version does not matter, it just needs to be less than 9)devDependency
in your package.json before running theng add
. That's it - you don't even need to install theeslint
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 runningng add
, use the default ESLint v9 setup. This will use the newangular-eslint
andtypescript-eslint
core packages, so you will see much fewer individual devDependencies added:2.
eslint
v8 devDependency is specified before runningng-add
. Use ESlint8.57.0
and the traditional@typescript-eslint/
and@angular-eslint/
packages.