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

[setup i18n storybook] Use function with capitalized name to comply with eslint-rule #11827

Merged
merged 2 commits into from
Dec 28, 2024

Conversation

Philzen
Copy link
Contributor

@Philzen Philzen commented Dec 28, 2024

Much nicer and shorter, as it doesn't require to disable an eslint-disable-*-annotation (for a rule that is actually not broken here).

Using a named function is a common pattern in storybook to comply with react-hooks/rules-of-hooks, for instance also when using hooks in a render method:

To avoid linting issues, it is recommended to use a function with a capitalized name.
If you are not concerned with linting, you may use an arrow function.

This is a common pattern often used in storybook to comply with `react-hooks/rules-of-hooks`, for instance also when using hooks in a render method: 

https://storybook.js.org/docs/writing-stories/args#setting-args-from-within-a-story
@Philzen Philzen changed the title [i18n] Use function with capitalized name to comply with eslint-rule [setup i18n storybook] Use function with capitalized name to comply with eslint-rule Dec 28, 2024
@Tobbe Tobbe added the release:fix This PR is a fix label Dec 28, 2024
@Tobbe Tobbe added this to the next-release-patch milestone Dec 28, 2024
@Tobbe Tobbe added the changesets-ok Override the changesets check label Dec 28, 2024
@Tobbe Tobbe enabled auto-merge (squash) December 28, 2024 08:10
@Tobbe Tobbe merged commit c5f5f03 into redwoodjs:main Dec 28, 2024
50 of 64 checks passed
@Philzen Philzen deleted the patch-17 branch December 28, 2024 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants