Skip to content
This repository has been archived by the owner on Oct 5, 2024. It is now read-only.

Indent issue on story source codes #99

Closed
niklasmh opened this issue Oct 9, 2019 · 2 comments · Fixed by #130
Closed

Indent issue on story source codes #99

niklasmh opened this issue Oct 9, 2019 · 2 comments · Fixed by #130
Assignees

Comments

@niklasmh
Copy link
Member

niklasmh commented Oct 9, 2019

Describe the bug

The source code in the storybook examples is misformatted.

This is probably a core storybook problem as someone else has already filed an issue on the topic: storybookjs/storybook#8078

To Reproduce

  1. Go to http://storybook.online.ntnu.no
  2. Navigate to Feedback -> Spinner -> Show code

Expected behavior

We want a pretty output:
image

Screenshots

Thus we are getting this instead:
image

@kharann
Copy link
Contributor

kharann commented Oct 31, 2019

Doesnt storybook have a linter?

@niklasmh
Copy link
Member Author

niklasmh commented Oct 31, 2019

@kharann I think they have some kind of formatter, or something configurable in normal js-stories, but it seems like mdx-stories do something different as the issue only exists there. Now I am just guessing, but it currently seems like a problem with the MDX implementation. I also noticed now that if we go back to normal old fashion stories (aka no MDX), we will not get the source code at all. This is apparently a known issue as well: storybookjs/storybook#8104. Another thing to notice is that this is only an issue with TS. Luckily for us they are actually working on it as we speak: storybookjs/storybook#8499

It is a @storybook/addon-docs problem, meaning it should probably be fixed by them. But if anyone here wants to debug and track down the core issue, you are more than welcome😄 It is still hacktober, so if you are up for a challenge, go for it!

They have it on their TODO, so they will hopefully fix it in the future:
image

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

Successfully merging a pull request may close this issue.

3 participants