-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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] forbid-component-props
: add allowedForPatterns
and disallowedForPatterns
options
#3805
base: master
Are you sure you want to change the base?
Conversation
@ljharb what do you think? |
lib/rules/forbid-component-props.js
Outdated
allowPatternList: typeof value === 'string' ? [] : value.allowedForPatterns || [], | ||
disallowList: typeof value === 'string' ? [] : (value.disallowedFor || []), | ||
disallowPatternList: typeof value === 'string' ? [] : value.disallowedForPatterns || [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allowPatternList: typeof value === 'string' ? [] : value.allowedForPatterns || [], | |
disallowList: typeof value === 'string' ? [] : (value.disallowedFor || []), | |
disallowPatternList: typeof value === 'string' ? [] : value.disallowedForPatterns || [], | |
allowPatternList: [].concat(value.allowedForPatterns || []), | |
disallowList: [].concat(value.disallowedFor || []), | |
disallowPatternList: [].concat(value.disallowedForPatterns || []), |
altho i'm not sure why any of these would be able to be strings - doesn't the schema prevent that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right about schema partially. There is also a string option there. Also, this rule has the default also for this rule, so that's why this code supports strings also.
Thanks a lot for the feedback, I will apply the changes. |
Honestly, not sure what to do with the "Automatic Rebase" action, didn't find any info in CONTRIBUTING.md |
Initially, issue was described here, but it was closed by another PR (although this PR implements different case).
So, this PR just reimplements
Regex
implementation withglobs
as was suggested in one of the comments.