Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

danreeves
Copy link
Contributor

@danreeves danreeves commented Sep 16, 2024

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.

@danreeves danreeves force-pushed the no-unstable-component-prop-pattern branch from ab0943d to 18a2d38 Compare September 17, 2024 00:40
@ljharb ljharb marked this pull request as draft September 17, 2024 16:36
@danreeves danreeves marked this pull request as ready for review September 17, 2024 18:47
@ljharb ljharb force-pushed the no-unstable-component-prop-pattern branch from 399954f to a1273d5 Compare September 26, 2024 18:02
@ljharb ljharb changed the title [New] Support custom prop naming conventions in no-unstable-component-prop-pattern [New] no-unstable-nested-components: add propNamePattern to support custom render prop naming conventions Sep 26, 2024
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@            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 Coverage Δ
94.36% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ljharb ljharb merged commit a1273d5 into jsx-eslint:master Sep 26, 2024
377 of 378 checks passed
renovate bot added a commit to mmkal/eslint-plugin-mmkal that referenced this pull request Sep 27, 2024
##### [v7.37.0](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/CHANGELOG.md#7370---20240926)

##### Added

-   add type generation ([#3830][] [@voxpelli](https://github.com/voxpelli))
-   \[`no-unescaped-entities`]: add suggestions ([#3831][] [@StyleShit](https://github.com/StyleShit))
-   \[`forbid-component-props`]: add `allowedForPatterns`/`disallowedForPatterns` options ([#3805][] [@Efimenko](https://github.com/Efimenko))
-   \[`no-unstable-nested-components`]: add `propNamePattern` to support custom render prop naming conventions ([#3826][] [@danreeves](https://github.com/danreeves))

##### Changed

-   \[readme] flat config example for react 17+ ([#3824][] [@GabenGar](https://github.com/GabenGar))

[7.36.2]: jsx-eslint/eslint-plugin-react@v7.36.1...v7.36.2

[#3831]: jsx-eslint/eslint-plugin-react#3831

[#3830]: jsx-eslint/eslint-plugin-react#3830

[#3826]: jsx-eslint/eslint-plugin-react#3826

[#3824]: jsx-eslint/eslint-plugin-react#3824

[#3805]: jsx-eslint/eslint-plugin-react#3805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants