Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/upgrade-typescript-v6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@codama/renderers-js": minor
---

Upgrade TypeScript to v6
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,21 @@
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.7",
"@codama/nodes-from-anchor": "^1.3.6",
"@solana/eslint-config-solana": "^5.0.0",
"@solana/eslint-config-solana": "^6.0.0",
"@solana/prettier-config-solana": "0.0.5",
"@types/node": "^25",
"@types/semver": "^7.7.1",
"agadoo": "^3.0.0",
"eslint": "^9.35.0",
"eslint": "^9.39.1",
"eslint-plugin-jest": "^29.2.1",
"eslint-plugin-react-hooks": "^7.0.1",
"globals": "^16.5.0",
"typescript-eslint": "^8.49.0",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What's this for?

Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown

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-solana bump 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-eslint needing a version that supports TS 6.0's new module resolution semantics). If pnpm lint passes on the main branch 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-solana v6 — 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-solana at v5 and only bump it if linting breaks. That would remove all 6 of these dependency changes and leave just the typescript version bump.

Copy link
Copy Markdown
Member

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-solana from v5 to v6 make use install these internal dependencies? Can you double check your findings?

Copy link
Copy Markdown

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-solana v6.0.0 declares all of these as peer dependencies:

  • eslint-plugin-jest: ^29.2.1
  • eslint-plugin-react-hooks: ^7.0.1
  • globals: ^16.5.0
  • typescript-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, and typescript)

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.json was relying on pnpm's autoInstallPeers: 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.json I 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 lint with TS 6.0. If it passes, you can drop all 6 dependency changes from this PR.

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

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?

Copy link
Copy Markdown
Contributor Author

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.

pnpm lint

> @codama/renderers-js@2.1.0
> eslint . && prettier --check .

=============


WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.


* @typescript-eslint/typescript-estree version: 8.43.0
* Supported TypeScript versions: >=4.8.4 <6.0.0
* Your TypeScript version: 6.0.2


Please only submit bug reports when using the officially supported version.


=============
Checking formatting...
All matched files use Prettier code style!

After 8726025:

pnpm lint

> @codama/renderers-js@2.1.0 lint
> eslint . && prettier --check .

Checking formatting...
All matched files use Prettier code style!

See also:
anza-xyz/eslint-config-solana@22456fd
typescript-eslint/typescript-eslint@4933417

"happy-dom": "^20.0.0",
"prettier": "^3.8.1",
"rimraf": "6.1.2",
"tsup": "^8.5.0",
"typescript": "^5.9.2",
"typescript": "^6.0.2",
"vitest": "^4.0.1"
},
"license": "MIT",
Expand Down
Loading
Loading