Skip to content

Support TypeScript 5.2.2#338

Open
dominicfraser wants to merge 5 commits into
shian15810:mainfrom
dominicfraser:depedencies
Open

Support TypeScript 5.2.2#338
dominicfraser wants to merge 5 commits into
shian15810:mainfrom
dominicfraser:depedencies

Conversation

@dominicfraser
Copy link
Copy Markdown

Context

TypeScript 5.2.2 comes with a breaking change that requires all @typescript-eslint/* dependencies to move to >= v6: typescript-eslint/typescript-eslint#7155 (comment).

In this repository that specifically means moving from

"@typescript-eslint/experimental-utils": "^5.3.0"

to

"@typescript-eslint/utils": "^6.0.0"

Changes

Add tests

To give more confidence that behaviour was preserved before and after making changes tests have been added.

This was done using the recommendations from https://typescript-eslint.io/developers/custom-rules#testing - use @typescript-eslint/rule-tester paired with vitest.

These tests can be reverted if they are not desired.

Update to @typescript-eslint/utils and typescript@5.2.2

This is the main change, allowing this really helpful plugin to continue to be used with newer typescript.

Comment thread src/rules/no-enum.ts
Comment thread tsconfig.json
"extends": "typesafeconfig",
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "Bundler",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added to allow TS to continue to pick up the correct types.

typescript-eslint/typescript-eslint#7284

Contains a warning when building, but appears to still produce the same output.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Does this issue persist into v8 of @typescript-eslint/utils?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It is fixed! Removed the patch in 34496c5.

Comment thread package.json
"homepage": "https://github.com/shian15810/eslint-plugin-typescript-enum#readme",
"dependencies": {
"@typescript-eslint/experimental-utils": "^5.3.0"
"@typescript-eslint/utils": "^6.7.2"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is the main change, and what removes the nested problematic tsutils package from the dependency tree: typescript-eslint/typescript-eslint#7155 (comment)

@shian15810 what do you think about this?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Could you bump this to major version 8 of @typescript-eslint/utils? Its latest version is currently 8.18.0.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done!

34496c5

@shian15810 shian15810 linked an issue Dec 15, 2024 that may be closed by this pull request
@shian15810
Copy link
Copy Markdown
Owner

This is a breaking change as well for this package I guess, might need to bump the major version~

@shian15810
Copy link
Copy Markdown
Owner

I'm thinking should I merge your PR and release a major version first before bumping @typescript-eslint/utils to v8 in another PR. This way people stuck with v6 of @typescript-eslint/utils could make use of your changes in this PR.

@dominicfraser What do you think?

@dominicfraser
Copy link
Copy Markdown
Author

Hi @shian15810 ☺️

I tested updating to v8, and pushed a commit showing what that would look like: 34496c5.

I've then reset it back to v6.

I think your plan of merging with the v6 changes, doing a release, and then updating to v8 and doing another release is a good plan. It gives flexibility to people to be able to update in stages if they need to 👍

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.

TypeScript 5.2.2 Support

2 participants