Conversation
caa11b5 to
35cda36
Compare
There was a problem hiding this comment.
Pull request overview
Updates the repository’s TypeScript toolchain to v6 and adjusts configuration/type-checking to accommodate TypeScript v6 default behavior changes (notably strict and rootDir defaults), while keeping emitted typings and runtime behavior stable.
Changes:
- Bumps
typescriptto^6.0.2and adds@types/natural-comparefor stricter type-checking. - Updates root
tsconfig.jsonto pinrootDirand selectively disable specific strictness flags. - Adjusts
src/index.jsrecommended config to reference the plugin via a getter (avoiding TS v6 inference issues) and tightenstests/types/tsconfig.jsonstrictness.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tsconfig.json | Pins rootDir to keep dist/ layout stable under TS v6 and overrides specific strict options. |
| tests/types/tsconfig.json | Re-enables strictNullChecks and useUnknownInCatchVariables for type tests despite root-level overrides. |
| src/index.js | Replaces post-definition assignment with a getter-based plugins.json reference to avoid TS v6 typing issues. |
| package.json | Updates TypeScript to v6 and adds missing ambient types for natural-compare. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Practical question: TypeScript v6 just came out, do we need to rush to support it? What happens if someone with TypeScript v6 tries to use a v5 package? Is there any end-user benefit or is this just about upgrading to the latest? |
I first tried upgrading TypeScript to v6 to see whether the deprecation of some options in v6 would affect our use case and end users, since those deprecations might have an impact. After investigating the codebase and reviewing the TypeScript v6 announcement, my understanding is that our current In summary, I think updating to TypeScript v6 will not affect end users because the output files remain unchanged. So, as a result, this PR simply upgrades to the latest version. |
Prerequisites checklist
AI acknowledgment
What is the purpose of this pull request?
This PR updates TypeScript to v6.
The following two changes mainly affected us during the upgrade to TypeScript v6.
strictmode is now the default.https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/#simple-default-changes
rootdirnow defaults to.https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/#rootdir-now-defaults-to-.
What changes did you make? (Give an overview)
I've tried to retain strict mode behavior as much as possible and only disabled it where it produced too many errors.
src/index.jsThe logic below produced a type error after upgrading to TypeScript v6, so I used an object getter instead to avoid the error and to avoid the block-syntax workaround.
json/src/index.js
Lines 39 to 42 in c9e816f
Freezing the configuration object wasn't considered a breaking change in eslint/eslint#20116, so using a getter here seems fine, but I'd welcome other opinions.
I've also verified that the output
index.d.tsfile is the same as before.tests/types/tsconfig.jsonstrictNullChecksanduseUnknownInCatchVariablesafter they were turned off in root leveltsconfig.json.package.json@types/natural-compareas a devDependency to fix a type error introduced by the TypeScript v6 breaking change.tsconfig.json"rootDir": "./src"to address the breaking change in TypeScript v6.strictNullChecksbecause adopting it would require extensive changes and it was previously disabled.useUnknownInCatchVariablesbecause adopting it requires some changes and it was previously disabled.Related Issues
N/A
Is there anything you'd like reviewers to focus on?
N/A