Skip to content

Update to Angular 20#189

Merged
mollykreis merged 7 commits intoni:mainfrom
m-akinc:angular20
Mar 19, 2026
Merged

Update to Angular 20#189
mollykreis merged 7 commits intoni:mainfrom
m-akinc:angular20

Conversation

@m-akinc
Copy link
Contributor

@m-akinc m-akinc commented Jan 29, 2026

Only rule changes are as follows:

  • @angular-eslint/component-class-suffix removed (was error)
  • @angular-eslint/directive-class-suffix removed (was error)

We also have a new recommended rule that we are disabling:

  • @angular-eslint/prefer-inject
    Apparently, using the inject() function is recommended over injection as constructor arguments. Angular even provides an automatic migration (ng generate @angular/core:inject), but it's not smart. It just puts new fields immediately before the constructor, but they need to be declared/initialized before any other field initializers that depend on them. For automation purposes (and probably as general convention), that means we want them declared at the top of the class. @typescript-eslint/member-ordering doesn't have an automated fix-up, nor the ability to take initializers into acount. The Perfectionist sort-classes rule has both of those, so I optimistically tried using that instead. We can configure their rule to enforce (and automate the sorting of) fields initialized with inject(... coming before all other fields. But I wasn't able to prevent it from auto-sorting getter/setter pairs with different access modifiers apart from each other (which is also a violation).

Aside from this it's unclear how painful it would be to update unit test code that might be constructing these objects directly. Based on all this, I'm disabling the rule.

@m-akinc m-akinc requested a review from jattasNI February 9, 2026 19:12
@m-akinc m-akinc requested a review from rajsite February 10, 2026 18:15
@mollykreis mollykreis merged commit bb2bd81 into ni:main Mar 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants