fix(sv): scope @deprecated tag to legacy create(cwd, options) overload#1064
Merged
jycouet merged 2 commits intoApr 17, 2026
Merged
Conversation
The JSDoc @deprecated on the first overload caused editors to mark the entire create export as deprecated, including the supported create({ cwd, ...options }) call. Reorder the overloads so the non-deprecated signature comes first; editors now strike through only the legacy positional form. Closes sveltejs#1063
🦋 Changeset detectedLatest commit: 2f5cd90 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 |
commit: |
Closed
3 tasks
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.
Closes #1063
Problem
The
@deprecatedJSDoc tag added in #1046 was intended to mark only the legacycreate(cwd, options)positional form, but in practice editors strike through every reference to thecreateexport — including correct calls likeimport { create } from 'sv'.That happens because VS Code and tsserver resolve a symbol's JSDoc from the first overload in source order. Since the deprecated overload was listed first, its
@deprecatedtag became the canonical documentation for the symbol itself.Fix
Reorder the overloads so the non-deprecated
create(options)signature is declared first. The@deprecatedtag now annotates only the legacycreate(cwd, options)overload, matching the original intent of #1046.Before:
import { create }→ shown as deprecatedcreate({ cwd, ... })→ shown as deprecatedcreate('./', { ... })→ shown as deprecatedAfter:
import { create }→ not deprecatedcreate({ cwd, ... })→ not deprecatedcreate('./', { ... })→ deprecated (as intended)Testing
pnpm buildregeneratespackages/sv/api-surface.mdwith the overload order swapped (included in the diff)pnpm checkpassespnpm lintpassesChangeset (
patch) included.