Skip to content

[Bug]: storysource code not formatted #22362

Closed as not planned
Closed as not planned
@mayank99

Description

@mayank99

Describe the bug

When using v7 with react+vite, the storysource code is much more reliable than it was in v6! However, one issue I've noticed is that when using story function format, the code is not formatted in a readable manner.

It would be nice if there was a way to run something like prettier on the code snippet (at build time) or just preserve original source formatting.

To Reproduce

7.1.0-alpha.11: https://stackblitz.com/edit/github-vusgyh?file=src%2Fstories%2FButton.stories.tsx

7.1.0-alpha.27: https://stackblitz.com/edit/github-vusgyh-pixhqk?file=src%2Fstories%2FButton.stories.tsx

7.1.0-beta.0: https://stackblitz.com/edit/github-vusgyh-mcgr2x?file=src%2Fstories%2FButton.stories.tsx

System

N/A. See stackblitz

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions