eslint-plugin-storybook
eslint-plugin-storybook copied to clipboard
`no-redundant-story-name` case insensitivity
Is your feature request related to a problem? Please describe.
Warn/error when storyName
is a case-insensitive variant of the name generated by the export name:
e.g. WithText.storyName = 'With Text';
will currently warn/error but WithText.storyName = 'with text';
will not
Describe the solution you'd like
The ability to configure the no-redundant-story-name
rule to use/ignore case when determining in the name is redundant
Describe alternatives you've considered Would also be open to this being the default behaviour if that's easier.
Additional context
I am working on a codebase where we used the storybook provided codemon to migrate our old storiesOf
stories to CSF
. Due to most of our old story names being all in lower-case, we now have a lot of instances where PascalCase.storyName = 'lower case'
. Engineers are then copying this format and spreading the issue. So while I can fix the existing set, I'd like a way to catch any future instances
Hey @benedfit thanks for opening this issue! I am not sure how valid this request is, given that there is a difference between the scenarios which you described:
-
WithText.storyName = 'With Text';
-
WithText.storyName = 'with text';
They will yield different results in the sidebar. People might actually want to specify names to be lower case, whilst the story name is upper case.
@yannbf I agree that there would be scenarios where folks want to specify lower case, so that's why it would be great for it to be an optional settings, and for it to work as it currently does by default