-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use typedef for JSDoc props and maintain comments (#13698)
* fix: use typedef for JSDoc props and maintain comments * chore: add comments * chore: add extra spaces and delete commented line
- Loading branch information
1 parent
663a3ca
commit 6ad017f
Showing
18 changed files
with
171 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'svelte': patch | ||
--- | ||
|
||
fix: use typedef for JSDoc props and maintain comments |
This file contains 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
8 changes: 7 additions & 1 deletion
8
packages/svelte/tests/migrate/samples/$$slots-used-as-variable-$$props/output.svelte
This file contains 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
10 changes: 9 additions & 1 deletion
10
packages/svelte/tests/migrate/samples/$$slots-used-as-variable/output.svelte
This file contains 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
7 changes: 6 additions & 1 deletion
7
packages/svelte/tests/migrate/samples/css-ignore/output.svelte
This file contains 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
28 changes: 28 additions & 0 deletions
28
packages/svelte/tests/migrate/samples/jsdoc-with-comments/input.svelte
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script> | ||
/** | ||
* My wonderful comment | ||
* @type {string} | ||
*/ | ||
export let comment; | ||
/** | ||
* My wonderful other comment | ||
* @type {number} | ||
*/ | ||
export let another_comment; | ||
// one line comment | ||
export let one_line; | ||
export let no_comment; | ||
/** | ||
* @type {boolean} | ||
*/ | ||
export let type_no_comment; | ||
/** | ||
* This is optional | ||
*/ | ||
export let optional = {stuff: true}; | ||
</script> |
31 changes: 31 additions & 0 deletions
31
packages/svelte/tests/migrate/samples/jsdoc-with-comments/output.svelte
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script> | ||
/** | ||
* @typedef {Object} Props | ||
* @property {string} comment - My wonderful comment | ||
* @property {number} another_comment - My wonderful other comment | ||
* @property {any} one_line - one line comment | ||
* @property {any} no_comment | ||
* @property {boolean} type_no_comment | ||
* @property {any} [optional] - This is optional | ||
*/ | ||
/** @type {Props} */ | ||
let { | ||
comment, | ||
another_comment, | ||
one_line, | ||
no_comment, | ||
type_no_comment, | ||
optional = {stuff: true} | ||
} = $props(); | ||
</script> |
8 changes: 7 additions & 1 deletion
8
packages/svelte/tests/migrate/samples/props-and-labeled/output.svelte
This file contains 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
7 changes: 6 additions & 1 deletion
7
packages/svelte/tests/migrate/samples/props-rest-props/output.svelte
This file contains 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
This file contains 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
This file contains 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
7 changes: 6 additions & 1 deletion
7
packages/svelte/tests/migrate/samples/slots-below-imports/output.svelte
This file contains 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
7 changes: 6 additions & 1 deletion
7
packages/svelte/tests/migrate/samples/slots-multiple/output.svelte
This file contains 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
9 changes: 8 additions & 1 deletion
9
packages/svelte/tests/migrate/samples/slots-with-$$props/output.svelte
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/svelte/tests/migrate/samples/svelte-component/output.svelte
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/svelte/tests/migrate/samples/svelte-self-name-conflict/output.svelte
This file contains 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
2 changes: 1 addition & 1 deletion
2
packages/svelte/tests/migrate/samples/svelte-self/output.svelte
This file contains 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