ArnaudBarre / eslint-plugin-react-refresh

Validate that your components can safely be updated with Fast Refresh
MIT License
217 stars 14 forks source link

Add option to check JS files (fixes #4) [publish] #5

Closed DianaSuvorova closed 1 year ago

DianaSuvorova commented 1 year ago

Fixes #4.

We are adding a way to parse all files. And in that case, we check that react is in scope. The default behavior is unchanged.

ArnaudBarre commented 1 year ago

Hi! Thanks for the initial work. Checking React import seems like a good trade-off, but maybe it would still be annoying for "hooks" files. We can improve in a next version if you find too many false positive.

I updated the the option to a more precise checkJS. Maybe later this will be changed to enable other extensions, but I prefer to be explicit and don't run the file on .ts file for mixed codebase for example.

If that's ok for you I can publish this as 0.3.3

DianaSuvorova commented 1 year ago

Yes, looks goog to me. Thank you!