You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a user, I want to have correctly formatted files after Storybook edits story files or creates new ones.
Format with prettier if available
If we can resolve a prettier config, we will format the file with prettier. We will resolve the user's installed prettier version to load their prettier file and to format files before saving them.
Basic formatting by considering .editorconfig
If we can't find a prettier config, we will format the file by taking into account the settings in the user's .editorconfig for basic formatting. The editorconfig has properties to define end_of_line, tab_width, indent_size, indent_style, trim_trailing_whitespace and insert_final_newline.
Requirements
Provide a helper util in @storybook/core-common to format the content of a file by following the rules mentioned above.
When an error occurs, the content should be returned without any formatting.
The text was updated successfully, but these errors were encountered:
As a user, I want to have correctly formatted files after Storybook edits story files or creates new ones.
If we can resolve a prettier config, we will format the file with prettier. We will resolve the user's installed prettier version to load their prettier file and to format files before saving them.
If we can't find a prettier config, we will format the file by taking into account the settings in the user's
.editorconfig
for basic formatting. The editorconfig has properties to defineend_of_line
,tab_width
,indent_size
,indent_style
,trim_trailing_whitespace
andinsert_final_newline
.Requirements
@storybook/core-common
to format the content of a file by following the rules mentioned above.The text was updated successfully, but these errors were encountered: