Skip to content
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

Update to Angular 18 #160

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Update to Angular 18 #160

wants to merge 14 commits into from

Conversation

m-akinc
Copy link
Contributor

@m-akinc m-akinc commented Jan 7, 2025

Addresses #157

In addition to updating the dependency version, I'm fixing the following:

Implementation

Updated dependencies:

  • @angular/core to 18.2.13 (latest <19)
  • @angular-eslint packages to 18.4.3 (latest <19)
  • @typescript-eslint/eslint-plugin and @typescript-eslint/parser to 7.18.0 (latest <8)
  • After updating the version of @typescript-eslint/parser, I began getting the following test failure:
    Error: Error while loading rule '@typescript-eslint/prefer-optional-chain': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
    Parser: C:\dev\javascript-styleguide\node_modules\@typescript-eslint\parser\dist\index.js
    Occurred while linting C:\dev\javascript-styleguide\tests\typescript\index.ts
    
    It turns out that @typescript-eslint/prefer-optional-chain now does require type checking, so I had to move it to the requiring-type-checking.js configuration.
  • @typescript-eslint/eslint-plugin version 6 introduced significant changes. In requiring-type-checking.js, I changed it from extending @typescript-eslint/recommended-requiring-type-checking to @typescript-eslint/recommended-type-checked and @typescript-eslint/stylistic-type-checked. Similarly, in eslint-config-typescript/index.js, I added @typescript-eslint/stylistic to the extended configs. Subsequently, the output of npm run print-evaluated-rules:diff showed over a dozen changes. I added overrides to minimize the scope of changes in this PR, and ultimately ended up with the following diff:
    • @typescript-eslint/consistent-generic-constructors is new ("error") -- Despite adding an override to turn this rule off, it remains on. This may be a bug in @typescript-eslint. I don't think we want to let this block us, so clients should either fix reported violations or use in-source suppressions.
    • @typescript-eslint/lines-between-class-members was ["error","always",{"exceptAfterSingleLine":true}], now is ["error","always",{"exceptAfterSingleLine":true,"exceptAfterOverload":true}] -- This seems like a harmless difference.
    • no-new-native-nonconstructor is new ("off") -- Explicitly turning off this new rule that defaulted to "error".
    • @typescript-eslint/no-duplicate-enum-values is new ("off") -- Explicitly turning off this new rule that defaulted to "error".
    • @typescript-eslint/no-unsafe-declaration-merging is new ("off") -- Explicitly turning off this new rule that defaulted to "error".
    • @typescript-eslint/no-duplicate-type-constituents is new ("off") -- Explicitly turning off this new rule that defaulted to "error".
    • @typescript-eslint/no-redundant-type-constituents is new ("off") -- Explicitly turning off this new rule that defaulted to "error".
    • @typescript-eslint/no-unsafe-enum-comparison is new ("off") -- Explicitly turning off this new rule that defaulted to "error".
    • @angular-eslint/runtime-localize is new ("error") -- We specifically want this enabled.

Testing

  • Ran npm run print-evaluated-rules:diff and handled differences as described above.
  • Ran npm run print-available-rules with these changes:
    • @typescript-eslint/no-duplicate-imports - removed from TS Extensions
    • @typescript-eslint/class-methods-use-this - added to TS Extensions
    • @typescript-eslint/max-params - added to TS Extensions
    • @typescript-eslint/prefer-ts-expect-error - moved from TS Recommended to Remaining TS Rules
    • @typescript-eslint/prefer-optional-chain - moved from TS Recommended to TS Recommended (Requiring Type Checks)
    • @typescript-eslint/no-implicit-any-catch - removed from Remaining TS Rules
    • @typescript-eslint/no-parameter-properties - removed from Remaining TS Rules
    • @typescript-eslint/sort-type-union-intersection-members - removed from Remaining TS Rules
    • @typescript-eslint/no-empty-object-type - added to Remaining TS Rules
    • @typescript-eslint/no-unnecessary-parameter-property-assignment - added to Remaining TS Rules
    • @typescript-eslint/no-unsafe-function-type - added to Remaining TS Rules
    • @typescript-eslint/no-wrapper-object-types - added to Remaining TS Rules
    • @typescript-eslint/no-empty-object-type - added to Remaining TS Rules
    • @typescript-eslint/no-empty-object-type - added to Remaining TS Rules
    • @typescript-eslint/consistent-return - added to TS Extensions (Requiring Type Checks)
    • @typescript-eslint/only-throw-error - added to TS Extensions (Requiring Type Checks)
    • @typescript-eslint/prefer-destructuring - added to TS Extensions (Requiring Type Checks)
    • @typescript-eslint/prefer-promise-reject-errors - added to TS Extensions (Requiring Type Checks)
    • @typescript-eslint/no-array-delete - added to TS Recommended (Requiring Type Checks)
    • @typescript-eslint/no-confusing-void-expression - moved from Remaining TS Rules (Requiring Type Checks) to TS Recommended (Requiring Type Checks)
    • @typescript-eslint/no-duplicate-type-constituents - moved from Remaining TS Rules (Requiring Type Checks) to TS Recommended (Requiring Type Checks)
    • @typescript-eslint/no-redundant-type-constituents - moved from Remaining TS Rules (Requiring Type Checks) to TS Recommended (Requiring Type Checks)
    • @typescript-eslint/no-unnecessary-template-expression - added to TS Recommended Requiring Type Checks
    • @typescript-eslint/use-unknown-in-catch-callback-variable - added to TS Recommended Requiring Type Checks
    • @typescript-eslint/no-unnecessary-type-parameters - added to Remaining TS Rules (Requiring Type Checks)
    • @typescript-eslint/no-unsafe-unary-minus - added to Remaining TS Rules (Requiring Type Checks)
    • @typescript-eslint/no-useless-template-literals - added to Remaining TS Rules (Requiring Type Checks)
    • @typescript-eslint/prefer-find - added to Remaining TS Rules (Requiring Type Checks)
    • @angular-eslint/no-host-metadata-property - moved from Angular Recommended to Remaining Angular
    • @angular-eslint/runtime-localize - added to Remaining Angular

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 ready to update clients.

@m-akinc m-akinc requested a review from jattasNI January 8, 2025 21:40
Copy link
Collaborator

@jattasNI jattasNI left a comment

Choose a reason for hiding this comment

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

Looks good to me, but withholding final approval until we're ready to start the release train.

@m-akinc m-akinc requested review from jattasNI and rajsite January 24, 2025 03:18
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