-
-
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
forbid-component-props: add component whitelist #1735
Conversation
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.
Thanks, this looks great!
(Docs will be needed, tho ;-) )
propName: { | ||
type: 'string' | ||
}, | ||
allowedFor: { |
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.
let's make sure this list is unique
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.
done; didn't know json schema has an option to require uniqueness
lib/rules/forbid-component-props.js
Outdated
const configuration = context.options[0] || {}; | ||
const configuration = context.options[0] || {}; | ||
const forbid = new Map((configuration.forbid || DEFAULTS).map(value => { | ||
const propName = (typeof value === 'string') ? value : value.propName; |
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.
let's remove the redundant parens on the ternary conditionals here and below
Docs added, changes done. |
cbcbcb2
to
805c8ea
Compare
Until jsx-eslint/eslint-plugin-react#1735 is merged, then we can just whitelist ReactModal.
Until jsx-eslint/eslint-plugin-react#1735 is merged, then we can just whitelist ReactModal.
Until jsx-eslint/eslint-plugin-react#1735 is merged, then we can just whitelist ReactModal.
Switch back to a release once these PRs are merged and in a release: - jsx-eslint/eslint-plugin-react#1729 - jsx-eslint/eslint-plugin-react#1755 - jsx-eslint/eslint-plugin-react#1735
Until jsx-eslint/eslint-plugin-react#1735 is merged, then we can just whitelist ReactModal.
Switch back to a release once these PRs are merged and in a release: - jsx-eslint/eslint-plugin-react#1729 - jsx-eslint/eslint-plugin-react#1755 - jsx-eslint/eslint-plugin-react#1735
Until jsx-eslint/eslint-plugin-react#1735 is merged, then we can just whitelist ReactModal.
Switch back to a release once these PRs are merged and in a release: - jsx-eslint/eslint-plugin-react#1729 - jsx-eslint/eslint-plugin-react#1755 - jsx-eslint/eslint-plugin-react#1735
Docs are still missing ;)
fixes #1732