-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Export pattern causes warning from eslint-plugin-react-refresh
#1534
Comments
same issue here, any updates? |
I would also prefer that there were no warnings. |
It was surprising that this hasn't been a major issue, but it seems that most of the components provided by shadcn/ui are following the |
Update the codebase to match my preferred style using `stylelint`, `eslint`, and `.editorconfig`. Run ESLint, Stylelint, and TypeScript in parallel on `pnpm run lint` with `npm-run-all`. Ignore the resulting cache files (`.eslintcache` and `.stylelintcache`). Remove the warning for allowing only constant exports in order to have shadcn/ui continue to export `buttonVariants` without throwing an error (see shadcn-ui/ui#1534). Alphabetically sort the configuration and code where possible (:abc:).
Update the codebase to match my preferred style using `stylelint`, `eslint`, and `.editorconfig`. Run ESLint, Stylelint, and TypeScript in parallel on `pnpm run lint` with `npm-run-all`. Ignore the resulting cache files (`.eslintcache` and `.stylelintcache`). Remove the warning for allowing only constant exports in order to have shadcn/ui continue to export `buttonVariants` without throwing an error (see shadcn-ui/ui#1534). Alphabetically sort the configuration and code where possible (:abc:).
Update the codebase to match my preferred style using `stylelint`, `eslint`, and `.editorconfig`. Run ESLint, Stylelint, and TypeScript in parallel on `pnpm run lint` with `npm-run-all`. Ignore the resulting cache files (`.eslintcache` and `.stylelintcache`). Remove the warning for allowing only constant exports in order to have shadcn/ui continue to export `buttonVariants` without throwing an error (see shadcn-ui/ui#1534). Alphabetically sort the configuration and code where possible (:abc:).
I found out that |
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you. |
Just came across this myself, maybe its worth considering re-opening? |
Same issue here in |
@GuillemPM For my use, I removed the |
Would be great if this was looked at again. |
This warning also appears when copypasting the theme provider example into a fresh create-vite project. Same workaround that @koutaro-masaki mentions works. Move the hook into its own file. |
What does one have to do to get a issue reopened around here, btw? I love this project, that's why I'd like for it to be better managed 🤓 |
Not ideal, but I had to restructure my project in order to fix it. Instead of having a single
|
So, there is still no solution to this issue? Besides splitting the generated file ourselves? |
bumping in 2025, still having this issue |
Button, Sidebar, and Form components are affected by this issue. To prevent ESLint warnings, I’ve temporarily added a directive above the relevant code, as I don’t want to modify the entire shadcn component structure.
|
After initializing in a new React Vite TS Storybook starter, that happened to have this eslint plugin installed, I get warnings on a number of files that export functions in addition to a component.
Also, although documentation about "Fast Refresh" is a bit scant unfortunately, some resources on it also say that each export requires its own export statement...
https://github.com/ArnaudBarre/eslint-plugin-react-refresh
...from my eslint config:
The text was updated successfully, but these errors were encountered: