feat: support TypeScript 6#675
Merged
Merged
Conversation
11 tasks
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.
|
Thank you for this patch, I look forward to it landing and releasing to npm so it resolves the peer dependency resolution issue blocking our project's upgrade to TS 6. ❤️ |
teemingc
commented
May 19, 2026
teemingc
commented
May 21, 2026
| aliases, | ||
| markupTagName = 'template', | ||
| sourceMap = process?.env?.NODE_ENV === 'development' ?? false, | ||
| sourceMap = process?.env?.NODE_ENV === 'development' || false, |
Member
Author
There was a problem hiding this comment.
Fixes this TypeScript error
Right operand of ?? is unreachable because the left operand is never nullish.
teemingc
commented
May 21, 2026
|
|
||
| expect(code).toBe(`<script lang="ts" context="module"></script>`); | ||
| expect(code).toBe( | ||
| `<script lang="ts" context="module">export {};\n</script>`, |
Member
Author
There was a problem hiding this comment.
Empty modules created with NodeNext always have export {} while ESNext simply has "use strict"
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.
This PR adds TS6 support by ensuring source files adhere to TS6 rules and updating one of the tests to expect the appropriate contents for a
module: NodeNextoutputBefore submitting the PR, please make sure you do the following
pnpm lint!)Tests
npm testorpnpm test