jsx-eslint / eslint-plugin-react

React-specific linting rules for ESLint
MIT License
9.01k stars 2.77k forks source link

[New] create ignorePrivate option for no-multi-comp rule #3842

Open vwillyams opened 1 month ago

vwillyams commented 1 month ago

Adds a new option to no-multi-comp which ignores components that are not exported.

Currently WIP:

vwillyams commented 1 month ago

FYI I will hopefully find time to have this ready for merge in the next 2-3 days. I'm going to get this working with RSCs and I also want to look at making the tests programmatically generated so that we can iterate over every possible permutation without having to write them all out individually (and risk missing something). In practice there's likely to be diminishing returns on that kind of testing but I assume that individual test cases are very cheap here and I don't really like the maintenance burden of the test cases I've added in this PR.

vwillyams commented 1 month ago

FYI I'm currently iterating on the test coverage and making sure this works in all cases. I didn't entirely expect the amount of complexity that would go into this feature! But it's been a fun learning process.