Repository navigation
fix: preserve empty type-only imports without introducing runtime side effects - #219
Merged
Merged
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/esrap/c/255b99d79b4fc61825ea9ac1243791ff9f7517c6Open in |
🦋 Changeset detectedLatest commit: 255b99d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
dummdidumm
approved these changes
Sep 25, 2026
leonidaz
added a commit
to leonidaz/esrap
that referenced
this pull request
Sep 25, 2026
sveltejs#219 prints `import type {} from` as one string; route its keyword and braces through the lookups like the non-empty form. Also mention keywords in the `tokens` option's documentation. Co-Authored-By: Claude Fable 5.1 <[email protected]> (cherry picked from commit f573c055666c07224f7666c2fb4a157d63d510de)
leonidaz
added a commit
to leonidaz/esrap
that referenced
this pull request
Sep 26, 2026
…nst token matching
`import type {} from` was written as one string since sveltejs#219, so with tokens
neither the keyword nor the braces could match; write them one token at a time.
Add tests for the comment handling the token matcher relies on: a comment whose
text is a bracket (`/* ( */`, `// )`, a commented-out block, a comment line
that is a lone `}`) must not be consumed as the next source token, and the
real brackets after it must still map exactly.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
leonidaz
added a commit
to leonidaz/esrap
that referenced
this pull request
Sep 26, 2026
…nst token matching
`import type {} from` was written as one string since sveltejs#219, so with tokens
neither the keyword nor the braces could match; write them one token at a time.
Add tests for the comment handling the token matcher relies on: a comment whose
text is a bracket (`/* ( */`, `// )`, a commented-out block, a comment line
that is a lone `}`) must not be consumed as the next source token, and the
real brackets after it must still map exactly.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
leonidaz
added a commit
to leonidaz/esrap
that referenced
this pull request
Sep 26, 2026
…nst token matching
`import type {} from` was written as one string since sveltejs#219, so with tokens
neither the keyword nor the braces could match; write them one token at a time.
Add tests for the comment handling the token matcher relies on: a comment whose
text is a bracket (`/* ( */`, `// )`, a commented-out block, a comment line
that is a lone `}`) must not be consumed as the next source token, and the
real brackets after it must still map exactly.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
leonidaz
added a commit
to leonidaz/esrap
that referenced
this pull request
Sep 26, 2026
…nst token matching
`import type {} from` was written as one string since sveltejs#219, so with tokens
neither the keyword nor the braces could match; write them one token at a time.
Add tests for the comment handling the token matcher relies on: a comment whose
text is a bracket (`/* ( */`, `// )`, a commented-out block, a comment line
that is a lone `}`) must not be consumed as the next source token, and the
real brackets after it must still map exactly.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
dummdidumm
pushed a commit
that referenced
this pull request
Nov 17, 2026
…nst token matching (#240) `import type {} from` was written as one string since #219, so with tokens neither the keyword nor the braces could match; write them one token at a time. Add tests for the comment handling the token matcher relies on: a comment whose text is a bracket (`/* ( */`, `// )`, a commented-out block, a comment line that is a lone `}`) must not be consumed as the next source token, and the real brackets after it must still map exactly.
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.
closes #171