dotkom / design-system

Component library, maybe
https://design.online.ntnu.no
MIT License
4 stars 4 forks source link

Indent issue on story source codes #99

Closed niklasmh closed 4 years ago

niklasmh commented 4 years ago

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: https://github.com/storybookjs/storybook/issues/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 commented 4 years ago

Doesnt storybook have a linter?

niklasmh commented 4 years ago

@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: https://github.com/storybookjs/storybook/issues/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: https://github.com/storybookjs/storybook/pull/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