Skip to content

fix: preserve missing type annotations and arguments (#174) - #179

Merged
manuel3108 merged 4 commits into
sveltejs:mainfrom
osamajvd:fix-missing-type-attributes
Aug 21, 2026
Merged

fix: preserve missing type annotations and arguments (#174)#179
manuel3108 merged 4 commits into
sveltejs:mainfrom
osamajvd:fix-missing-type-attributes

Conversation

@osamajvd

Copy link
Copy Markdown
Contributor

Fixes #174

Originally, I ran into an issue with the sv CLI's migration for Sveltekit 3 where generic type arguments on my drizzle queries were being dropped.

Found issue 174 which noted three other locations which would also result in dropped type attributes during migration.

Changes

  • Tagged templates: Keep type arguments so they aren't stripped (e.g. tag<Type>`...` ).
  • Array destructuring: Keep type annotations on array patterns (e.g. [a, b]: string[]).
  • Template literal types: Don't drop string prefixes/suffixes in template types (e.g. `${string}_sfx`).
  • JSDoc nullable types: Add missing support for printing ?T / T?.

@pkg-svelte-dev

pkg-svelte-dev Bot commented Aug 20, 2026

Copy link
Copy Markdown

Install the latest version of esrap from 0c097db:

pnpm add https://pkg.svelte.dev/esrap/c/0c097db2efb4bee32a21cdeaf409d234bc4ac928

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/esrap/pr/179

Note

This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed.

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c097db

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
esrap Patch

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

Comment thread .changeset/six-pianos-know.md Outdated
Comment thread src/languages/ts/index.js
@manuel3108
manuel3108 merged commit a46e8a2 into sveltejs:main Aug 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TS printing gaps: tagged-template typeArguments, TSTemplateLiteralType quasis, ArrayPattern annotation, TSJSDocNullableType

2 participants