Print type arguments and end expression default exports with a semicolon - #84
Merged
NullVoxPopuli merged 1 commit intoSep 4, 2026
Conversation
oxc-parser and typescript-estree v8 store type arguments on `typeArguments` (and `superTypeArguments` on classes). The printer only read `typeParameters`, so calls, `new`, type references, heritage clauses, `satisfies`, and `typeof` lost their `<...>` on print. The printer now reads `typeArguments` first and falls back to `typeParameters` for older parsers. `TSImportType` reads `source` the same way. `export default <expression>` printed without a trailing semicolon. A following line that starts with `(` or a backtick would then parse as a call. Function and class declarations keep no semicolon. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fvnp457DHuZC4fBa2KCiqB
NullVoxPopuli
approved these changes
Sep 4, 2026
Merged
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.
Found while porting
content-tag-utils/unprocessfrom jscodeshift to ember-estree. The round trip ofexport default template(...) satisfies TOC<{}>came back asexport default <template>...</template> satisfies TOC.Type arguments were dropped on print
oxc-parser and typescript-estree v8 store type arguments on
typeArguments, andsuperTypeArgumentson classes.printonly readtypeParameters, so these lost their<...>:new, and tagged templatesArray<string>extendsandimplementsclausessatisfies, instantiation expressions,typeof x<Y>, andimport('m').T<U>printTypeArgumentsnow readstypeArgumentsfirst and falls back totypeParametersfor older parsers.export default <expression>had no semicolonexport default xfollowed by a line that starts with(or a backtick parses as a call. The printer now ends expression default exports with;. Function and class declarations are unchanged.Tests cover both cases with source round trips.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Fvnp457DHuZC4fBa2KCiqB