Skip to content
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

no-redundant-story-name case insensitivity #94

Open
benedfit opened this issue Jun 13, 2022 · 2 comments
Open

no-redundant-story-name case insensitivity #94

benedfit opened this issue Jun 13, 2022 · 2 comments
Labels
needs followup Needs further information for issue/PR to be valid

Comments

@benedfit
Copy link

benedfit commented Jun 13, 2022

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

@yannbf
Copy link
Member

yannbf commented Jan 25, 2023

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:

  1. WithText.storyName = 'With Text';
  2. 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 yannbf added the needs followup Needs further information for issue/PR to be valid label Jan 25, 2023
@benedfit
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs followup Needs further information for issue/PR to be valid
Projects
None yet
Development

No branches or pull requests

2 participants