fix: typescript 6.0 compatibility#2988
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: d43d6e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
GrygrFlzr
reviewed
Mar 25, 2026
Comment on lines
+74
to
+79
| const factory = | ||
| major === 5 && minor < 3 | ||
| ? createProject50 | ||
| : major === 5 && minor < 5 | ||
| ? createProject53 | ||
| : createProject55; |
Member
There was a problem hiding this comment.
The original double ternary was already kind of difficult to read, would it be too much to refactor to an IIFE
const factory = (() => {
if (major === 5 && minor < 3) return createProject50;
if (major === 5 && minor < 5) return createProject53;
return createProject55;
})();Which is probably more friendly to future additions, e.g. a hypothetical
const factory = (() => {
if (major === 5 && minor < 3) return createProject50;
if (major === 5 && minor < 5) return createProject53;
if (major === 5 && minor <= 9) return createProject55;
return createProject60;
})();And would have made it easier to spot the initial issue, as it would have been like this:
const factory = (() => {
if (minor < 3) return createProject50;
if (minor < 5) return createProject53;
return createProject55;
// clearly not checking major
})();
Member
Author
There was a problem hiding this comment.
Tweaked. This might be the last time we touch this 😆. There most likely won't be a new version anyway.
GrygrFlzr
approved these changes
Mar 25, 2026
Merged
11 tasks
bdarcus
added a commit
to citum/citum-hub
that referenced
this pull request
Mar 28, 2026
Raise svelte-check to the newest published release and patch its\nproject factory selection at install time until upstream ships the\nTypeScript 6 compatibility fix from sveltejs/language-tools#2988.\n\nAlso fix the remaining client-side TypeScript 6 inference regressions\nin wizard and style pages so lint, format, check, and build pass on the\nupgraded branch.
bdarcus
added a commit
to citum/citum-hub
that referenced
this pull request
Mar 28, 2026
Raise svelte-check to the newest published release and patch its project factory selection at install time until upstream ships the TypeScript 6 compatibility fix from sveltejs/language-tools#2988. Pin svelte-check to the patched release and make the postinstall workaround non-fatal when the upstream file no longer matches the expected snippet so installs do not break on already-fixed packages or minor internal drift. Also fix the remaining client-side TypeScript 6 inference regressions in wizard and style pages so lint, format, check, and build pass on the upgraded branch.
bdarcus
added a commit
to citum/citum-hub
that referenced
this pull request
Mar 28, 2026
Raise svelte-check to the newest published release and patch its project factory selection at install time until upstream ships the TypeScript 6 compatibility fix from sveltejs/language-tools#2988. Pin svelte-check to the patched release and make the postinstall workaround non-fatal when the upstream file no longer matches the expected snippet so installs do not break on already-fixed packages or minor internal drift. Also fix the remaining client-side TypeScript 6 inference regressions in wizard and style pages so lint, format, check, and build pass on the upgraded branch.
teemingc
added a commit
to sveltejs/kit
that referenced
this pull request
Apr 1, 2026
closes #15372 This PR extends the SvelteKit peerDep range to include TS 6.0. It also upgrades our apps/packages using TS purely as a devDependency to use 6.0 (this excludes `kit` because we use TS to generate public types and that can be a breaking change. `package` is also excluded because it can't support TS6 until svelte2tsx does). ### TODOs - [x] update `svelte-check` sveltejs/language-tools#2988 Required for `@sveltejs/package` if we want to support TS6 in the future: - [ ] update `svelte2tsx` sveltejs/language-tools#2985 - [ ] update `svelte-preprocess` sveltejs/svelte-preprocess#675 Required for SvelteKit 3 when we switch over to TS6 completely - [x] update `@sveltejs/eslint-config` sveltejs/eslint-config#67 - [ ] update `dts-buddy` sveltejs/dts-buddy#123 --- ### Please don't delete this checklist! Before submitting the PR, please make sure you do the following: - [ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [ ] This message body should clearly illustrate what problems it solves. - [ ] Ideally, include a test that fails without this PR but passes with it. ### Tests - [ ] Run the tests with `pnpm test` and lint the project with `pnpm lint` and `pnpm check` ### Changesets - [ ] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running `pnpm changeset` and following the prompts. Changesets that add features should be `minor` and those that fix bugs should be `patch`. Please prefix changeset messages with `feat:`, `fix:`, or `chore:`. ### Edits - [ ] Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
extracted from #2985. This is the only runtime compatibility problem I found with TypeScript 6.0. Extracted out so we can release this separately.