shimful / eslint-plugin-react-lite

Zero-dependency reimplementations of the most essential eslint-plugin-react rules
MIT License
2 stars 0 forks source link

display-name on Context is useful #3

Open ArnaudBarre opened 3 months ago

ArnaudBarre commented 3 months ago

Hi, thanks for this, I hope this package get traction. I may add it to the default starter for Vite ESLint templates.

I've also migrated the rules I needed on my custom config, and one of them was one to ensure Context gets a proper name so in the devtools you get FormContext.Provider and not some generic Context.Provider. For components I think this is not needed.

My implementation (The same name check is a safety check against copy paste, but might be to opinionated for public rules)

jviide commented 3 months ago

Thanks! This clears it up, I updated README.md accordingly.