Skip to content
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

@deprecated JSDoc isn't respected for component props #2491

Open
theetrain opened this issue Sep 6, 2024 · 1 comment
Open

@deprecated JSDoc isn't respected for component props #2491

theetrain opened this issue Sep 6, 2024 · 1 comment
Labels

Comments

@theetrain
Copy link

theetrain commented Sep 6, 2024

Description

Deprecating component props do not yield any apparent warnings in Svelte 4 and Svelte 5.

Example Svelte 4 code:

<script>
  /**
   * @type { boolean }
   * @deprecated Will be removed in next major.
   */
  export let test = false
</script>

Example Svelte 5 code:

<script>
  /**
   * @typedef {boolean} Test
   * @deprecated Will be removed in next major.
   */
  
  /** @type {{ test: Test }} */
  let { test } = $props()
</script>

Proposed solution

When deprecating a component prop:

  • have it appear crossed-out in my editor for component consumers (not just internally to the component)
  • display a warning reported by svelte-check when deprecated props are used.

Alternatives

No response

Additional Information, eg. Screenshots

Svelte 5 example, props used internally are crossed out. In this image, burst is incorrectly crossed out.

image

No deprecation warning when consuming Svelte 5 component.

image

Svelte 4 example, internal usage is correctly deprecated.

image

Consumption is documented as deprecated without being crossed out.

image
@jasonlyu123
Copy link
Member

Probably related to microsoft/TypeScript#45657

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants