Is there an existing issue for this?
Description Overview
My team uses react/forbid-component-props to disallow className and style props, but we maintain a list of legacy components that took these props before we introduced this rule. We now also have a bunch of icon components in the codebase that all have names like Icon24Something. We like to pass style or className props to these to override css properties in some cases, so it'd be nice to be able to allow any component that matches /^Icon\d+/.
Does this sound like a change you'd be happy to accept? I'd be okay sending a PR. Otherwise I'm also happy to fork the rule internally for our use case, but figured I'd check here to contribute back to the community.
Expected Behavior
I'd expect to be able to pass a regex to allowedFor.
eslint-plugin-react version
v7.32.2
eslint version
v8.36.0
node version
v18.17.1
Is there an existing issue for this?
Description Overview
My team uses
react/forbid-component-propsto disallow className and style props, but we maintain a list of legacy components that took these props before we introduced this rule. We now also have a bunch of icon components in the codebase that all have names likeIcon24Something. We like to pass style or className props to these to override css properties in some cases, so it'd be nice to be able to allow any component that matches/^Icon\d+/.Does this sound like a change you'd be happy to accept? I'd be okay sending a PR. Otherwise I'm also happy to fork the rule internally for our use case, but figured I'd check here to contribute back to the community.
Expected Behavior
I'd expect to be able to pass a regex to
allowedFor.eslint-plugin-react version
v7.32.2
eslint version
v8.36.0
node version
v18.17.1