Skip to content

(svelte2tsx) jsdoc typedef comment duplication #612

@jasonlyu123

Description

@jasonlyu123

Describe the bug
Jsdoc typedef comment before export props got copied as component props documentation. This causes a duplicate identifier error.

To Reproduce

<script>
  /**
   * @typedef {{a: string}} A
  */

  /**@type {string}*/
  export let props;
</script>

got transformed to

///<reference types="svelte" />
<></>;function render() {

  /**
   * @typedef {{a: string}} A
  */

  /**@type {string}*/
   let props;
;
() => (<>
</>);
return { props: {
/**
   * @typedef {{a: string}} A
  */props: props}, slots: {}, getters: {}, events: {} }}

export default class extends createSvelte2TsxComponent(__sveltets_partial(__sveltets_with_any_event(render))) {
}

Expected behavior
doesn't not copy it. we probably have to filter out some of the comment.

System (please complete the following information):

  • OS: Windows
  • IDE: VSCode
  • Plugin/Package: Svelte for VSCode, svelte2tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedFixed in master branch. Pending production release.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions