Property descriptions missing from Docs Page on Svelte + TypeScript
See original GitHub issueDescribe the bug
When a Svelte component is using plain JavaScript, its property descriptions are extracted from JSDoc blocks inside the component. However, if you switch <script>
with <script lang="ts">
(and optionally adding some types in there), it stops picking up anything at all.
To Reproduce https://github.com/notpushkin/repro-storybook-svelte-typescript
git clone https://github.com/notpushkin/repro-storybook-svelte-typescript.git
cd repro-storybook-svelte-typescript
yarn
yarn storybook
System
Environment Info:
System:
OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
CPU: (4) x64 Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz
Binaries:
Node: 14.17.5 - /usr/bin/node
Yarn: 1.22.5 - /usr/bin/yarn
npm: 6.14.14 - /usr/bin/npm
Browsers:
Firefox: 91.0
npmPackages:
@storybook/addon-actions: ^6.4.0-alpha.30 => 6.4.0-alpha.30
@storybook/addon-essentials: ^6.4.0-alpha.30 => 6.4.0-alpha.30
@storybook/addon-links: ^6.4.0-alpha.30 => 6.4.0-alpha.30
@storybook/addon-svelte-csf: ^1.1.0 => 1.1.0
@storybook/svelte: ^6.4.0-alpha.30 => 6.4.0-alpha.30
Additional context Possibly related? #14876
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Docs • Svelte
This page contains detailed API reference documentation. ... Readonly props can be accessed as properties on the element, tied to the component using ......
Read more >19 - Stack Overflow
when I run the rollup script to compile svelte app, i am getting cannot find module ./App.svelte error as shown below. Plugin typescript:...
Read more >Building Svelte Society: Svelte and TypeScript with Simon H
TypeScript in Svelte can be a bit of a mystery. Especially if you don't know TypeScript. Today I'm getting some expert help from...
Read more >TypeScript support in Svelte - Learn web development
First add the lang="ts" to our <script> tag. Let's import the type and use it to declare the todo property. Replace the export...
Read more >TSConfig Reference - Docs on every TSConfig option
A TSConfig file in a directory indicates that the directory is the root of a TypeScript or JavaScript project... Compiler Options. Top Level....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello! Has anyone had the chance to look into this? I’m using
6.5.0-alpha.49
and no js doc info is pulled when my script tag is marked aslang=ts
(regardless of if the variable has a type declaration).It definitely is my preference to be able to use typescript as expected and have my js doc comments pulled into the storybook UI. The automatic documentation is such a cool feature! Definitely unfortunate to have to choose between it and using typescript in svelte components.
You can track https://github.com/alexprey/sveltedoc-parser/issues/34 for typescript support in the package we use to extract docs information from svelte files.