ArnaudBarre / eslint-plugin-react-refresh

Validate that your components can safely be updated with fast refresh
MIT License
198 stars 9 forks source link

Question about potential problems with barrel files #37

Closed kylemh closed 6 months ago

kylemh commented 7 months ago

Hello! This isn't really an issue. Just a question...

Screenshot 2024-02-15 at 8 51 32 PM

I've got a monorepo with a ui package that exports hooks, utils, and components.

We export this by doing a barrel file for all hooks, all utils, and components... then we do one package-level barrel-file that exports all the contents of the 3 other barrel files. That top-level barrel file is marked as main and types in the ui package's package.json. Then, I symlink the package as via installing it in other monorepo applications like:

"@scoped/ui": "workspace:*"

Am I potentially hurting fast refresh for the applications with this setup?

ArnaudBarre commented 6 months ago

If you rename the file to index.ts it will be fine!