-
Notifications
You must be signed in to change notification settings - Fork 18
fix: preserve missing type annotations and arguments (#174) #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
manuel3108
merged 4 commits into
sveltejs:main
from
osamajvd:fix-missing-type-attributes
Aug 21, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b36710e
fix: preserve type arguments on tagged template expressions
osamajvd a7bd558
fix: resolve remaining TS printing gaps for array patterns, template …
osamajvd 1be1ef5
chore: add changeset
osamajvd 0c097db
Update .changeset/six-pianos-know.md
manuel3108 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'esrap': patch | ||
| --- | ||
|
|
||
| fix: preserve type arguments on tagged templates, array pattern annotations, and template literal type quasis |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| const [a, b]: string[] = ['foo', 'bar']; | ||
|
|
||
| function fn([first, second]: number[]) { | ||
| return first + second; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "version": 3, | ||
| "names": [], | ||
| "sources": [ | ||
| "input.js" | ||
| ], | ||
| "sourcesContent": [ | ||
| "const [a, b]: string[] = ['foo', 'bar'];\n\nfunction fn([first, second]: number[]) {\n\treturn first + second;\n}\n" | ||
| ], | ||
| "mappings": "AAAA,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,MAAM,KAAK,EAAE,KAAK;;AAEtC,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,IAAI,CAAC;CACvC,MAAM,CAAC,KAAK,GAAG,MAAM;AACtB,CAAC" | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| const [a, b]: string[] = ['foo', 'bar']; | ||
|
|
||
| function fn([first, second]: number[]) { | ||
| return first + second; | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| sql<string[]>`SELECT * FROM table`; | ||
|
|
||
| const res = tag<A, B>`hello ${world}`; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "version": 3, | ||
| "names": [], | ||
| "sources": [ | ||
| "input.js" | ||
| ], | ||
| "sourcesContent": [ | ||
| "sql<string[]>`SELECT * FROM table`;\nconst res = tag<A, B>`hello ${world}`;\n" | ||
| ], | ||
| "mappings": "AAAA,GAAG,CAAC,MAAM;;AACV,MAAM,AAAA,GAAG,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,UAAU,KAAK" | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| sql<string[]>`SELECT * FROM table`; | ||
| const res = tag<A, B>`hello ${world}`; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| type Event = `on${string}`; | ||
| type Path<T extends string> = `/${T}/index.html`; | ||
| type Plain = `static_string`; | ||
| type Multi<A extends string, B extends string> = `prefix_${A}_middle_${B}_suffix`; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "version": 3, | ||
| "names": [], | ||
| "sources": [ | ||
| "input.js" | ||
| ], | ||
| "sourcesContent": [ | ||
| "type Event = `on${string}`;\ntype Path<T extends string> = `/${T}/index.html`;\ntype Plain = `static_string`;\ntype Multi<A extends string, B extends string> = `prefix_${A}_middle_${B}_suffix`;\n" | ||
| ], | ||
| "mappings": "KAAK,KAAK,QAAQ,MAAM;KACnB,IAAI,CAAC,CAAgB,SAAN,MAAM,QAAQ,CAAC;KAC9B,KAAK;KACL,KAAK,CAAC,CAAgB,SAAN,MAAM,EAAE,CAAgB,SAAN,MAAM,cAAc,CAAC,WAAW,CAAC" | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| type Event = `on${string}`; | ||
| type Path<T extends string> = `/${T}/index.html`; | ||
| type Plain = `static_string`; | ||
| type Multi<A extends string, B extends string> = `prefix_${A}_middle_${B}_suffix`; |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.