jsx-eslint / eslint-plugin-react

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

[New] `no-unstable-nested-components`: add `propNamePattern` to support custom render prop naming conventions #3826

Closed danreeves closed 1 month ago

danreeves commented 2 months ago

I would like to adopt this rule but render* is not the only render prop naming convention in my codebases. Namely libraries such as react-virtualized have a *Renderer convention.

This PR adds the ability to customize the prop name matcher.

~At the same time I cleaned up the customValidators documentation that appears to have been copy/paste error at implementation. I believe this would close 3664, which asks to document this non-existent option.~

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.36%. Comparing base (d687e25) to head (a1273d5). Report is 33 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3826 +/- ## ========================================== - Coverage 97.77% 94.36% -3.41% ========================================== Files 135 133 -2 Lines 9750 9946 +196 Branches 3575 3688 +113 ========================================== - Hits 9533 9386 -147 - Misses 217 560 +343 ``` | [Flag](https://app.codecov.io/gh/jsx-eslint/eslint-plugin-react/pull/3826/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jsx-eslint) | Coverage Δ | | |---|---|---| | [](https://app.codecov.io/gh/jsx-eslint/eslint-plugin-react/pull/3826/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jsx-eslint) | `94.36% <100.00%> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jsx-eslint#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.