-
Notifications
You must be signed in to change notification settings - Fork 8
Upgrade TypeScript to v6 #137
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
Open
ioxde
wants to merge
3
commits into
codama-idl:main
Choose a base branch
from
ioxde:typescript-v6-upgrade
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@codama/renderers-js": minor | ||
| --- | ||
|
|
||
| Upgrade TypeScript to v6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trevor-cortex Is any of this required in the scope of this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. The
@solana/eslint-config-solanabump from v5 to v6 is not strictly required for the TypeScript v6 upgrade itself. The TS 6.0 changes (tsconfig updates) are independent of the ESLint config version.However, it's likely included because the v5 eslint config may have compatibility issues with TS 6.0 (e.g.
typescript-eslintneeding a version that supports TS 6.0's new module resolution semantics). Ifpnpm lintpasses on themainbranch with TS 6.0 + the old eslint config v5, then this bump could be split into a separate PR.The new explicit deps (
eslint-plugin-jest,eslint-plugin-react-hooks,globals,typescript-eslint) are peer dependencies of@solana/eslint-config-solanav6 — with pnpm's strict dependency resolution, they need to be listed explicitly. They wouldn't be needed if you stayed on v5.So: if you want to keep this PR minimal (just TS 6.0 compat), you could try keeping
@solana/eslint-config-solanaat v5 and only bump it if linting breaks. That would remove all 6 of these dependency changes and leave just thetypescriptversion bump.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trevor-cortex Hmm why would bumping
@solana/eslint-config-solanafrom v5 to v6 make use install these internal dependencies? Can you double check your findings?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right to push back — I was wrong about these being "internal dependencies that now need to be explicit."
Looking at the lockfile,
@solana/eslint-config-solanav6.0.0 declares all of these as peer dependencies:eslint-plugin-jest: ^29.2.1eslint-plugin-react-hooks: ^7.0.1globals: ^16.5.0typescript-eslint: ^8.49.0(along with
@eslint/js,eslint,eslint-plugin-simple-import-sort,eslint-plugin-sort-keys-fix,eslint-plugin-typescript-sort-keys,jest, andtypescript)With pnpm's strict dependency model, peer deps need to be explicitly listed by the consumer. But this isn't a change from v5 → v6 that introduced these as new peer deps. More likely, v5 had a similar set of peer deps, and the previous
package.jsonwas relying on pnpm'sautoInstallPeers: true(which is set in the lockfile) to resolve them transitively without listing them.So the real question is: why are these 4 now listed explicitly when they weren't before? It could be that v5 had them as regular dependencies (not peer deps), or that v6 added them as new peer deps. Without checking v5's
package.jsonI can't say for certain, but my earlier claim that this was about pnpm strictness was an oversimplification.Bottom line: if you want to test whether the eslint config bump is needed at all, try keeping v5 and running
pnpm lintwith TS 6.0. If it passes, you can drop all 6 dependency changes from this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ioxde Sorry for the AI noise but I think these should go. Lmk if I'm missing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! No you didn't miss anything. I reverted the unnecessary package updates. Do you want me to merge the commits into one and force push?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reinstalling with the d52663e change eslint complained about being unsupported. I pushed 8726025 as the minimal amount of changes I could make to get rid of that warning.
After 8726025:
See also:
anza-xyz/eslint-config-solana@22456fd
typescript-eslint/typescript-eslint@4933417