Skip to content

fix: revert jsdoc type cast support (for now) - #165

Merged
dummdidumm merged 1 commit into
mainfrom
revert-jsdoc-type-cast
Aug 14, 2026
Merged

fix: revert jsdoc type cast support (for now)#165
dummdidumm merged 1 commit into
mainfrom
revert-jsdoc-type-cast

Conversation

@dummdidumm

Copy link
Copy Markdown
Member

Fixes #164; we'll follow up with a better solution

Fixes #164; we'll follow up with a better solution
@pkg-svelte-dev

Copy link
Copy Markdown

Install the latest version of esrap from f3216a3:

pnpm add https://pkg.svelte.dev/esrap/c/f3216a3a351a7d9dad197a3a5e8af63fc7ad203d

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

@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f3216a3

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

@dummdidumm
dummdidumm merged commit e51f38f into main Aug 14, 2026
6 checks passed
@dummdidumm
dummdidumm deleted the revert-jsdoc-type-cast branch August 14, 2026 20:22
elliott-with-the-longest-name-on-github added a commit that referenced this pull request Aug 17, 2026
…rs (#167)

* Revert "fix: revert jsdoc type cast support (for now) (#165)"

This reverts commit e51f38f.

* fix: don't treat JSDoc @type comments on bindings as type casts

Fixes #164 by tracking nodes in binding positions (variable declarator
ids, function/method/arrow params, catch clause params) and excluding
them from JSDoc type cast detection, so `let /** @type {T} */ x;`
prints valid output while `/** @type {T} */ (expr)` casts keep their
parentheses.

* refactor: rename binding trackers and make them void for CQS
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.

2.3.3 regression: JSDoc @type comments on hoisted let declarations produce invalid output like let (foo);

2 participants