-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSF-tools: Allow type checking in story title #22791
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general, but we would like to remain specific about what a title can be, even if it is a satisfies expression.
code/lib/csf-tools/src/CsfFile.ts
Outdated
if (t.isTSSatisfiesExpression(node)) return node.expression.value; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like we want here that satisfies expression only be able to contain a string then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, thank you for pointing that out 👍
I just wanted to hotfix it for my personal use and then forgot about this condition while making it public
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
What can I do to get this merged? |
What I did
V7 disallows using expressions and variables for story titles. This PR allows the title to conform to a certain (nested) structure using
satisfies
operator.How to test
Run storybook on this branch and use
satisfies
in the story title definitionChecklist
MIGRATION.MD
Maintainers
make sure to add the
ci:merged
orci:daily
GH label to it.["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]