Skip to content

Update to Angular 20#189

Open
m-akinc wants to merge 6 commits intoni:mainfrom
m-akinc:angular20
Open

Update to Angular 20#189
m-akinc wants to merge 6 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't submit until all Angular upgrade PRs are queued up and ready.

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

3 participants