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

Fix: specify @default undefined for undefined prop values #64

Merged
merged 4 commits into from
Jan 21, 2022

Conversation

metonym
Copy link
Collaborator

@metonym metonym commented Jan 18, 2022

Currently, exported props that are undefined by default do not have a corresponding @default comment in the generated TypeScript definition.

Input

<script>
  /** @type {boolean} */
  export let prop;
</script>

Current output

export interface InputProps {
  prop?: boolean;
}

Expected output

export interface InputProps {
+  /**
+   * @default undefined
+   */
  prop?: boolean;
}

Fixes

  • specify @default undefined for undefined prop values in TypeScript definitions
  • use <code>undefined</code> instead of -- for undefined default values in Markdown

@metonym metonym merged commit 146ebc9 into main Jan 21, 2022
@metonym metonym deleted the fix-default-undefined branch January 21, 2022 02:52
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.

1 participant