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

forbid-component-props: add component whitelist #1735

Merged
merged 6 commits into from
Apr 1, 2018

Conversation

ThiefMaster
Copy link
Contributor

Docs are still missing ;)

fixes #1732

Copy link
Member

@ljharb ljharb left a 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: {
Copy link
Member

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

Copy link
Contributor Author

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

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;
Copy link
Member

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

@ThiefMaster
Copy link
Contributor Author

Docs added, changes done.

ThiefMaster added a commit to ThiefMaster/indico that referenced this pull request Mar 26, 2018
Until jsx-eslint/eslint-plugin-react#1735 is merged, then we can just
whitelist ReactModal.
ThiefMaster added a commit to ThiefMaster/indico that referenced this pull request Mar 26, 2018
Until jsx-eslint/eslint-plugin-react#1735 is merged, then we can just
whitelist ReactModal.
@ljharb ljharb merged commit 5890533 into jsx-eslint:master Apr 1, 2018
@ThiefMaster ThiefMaster deleted the forbid-component-props branch April 1, 2018 22:52
ThiefMaster added a commit to indico/indico that referenced this pull request Apr 9, 2018
Until jsx-eslint/eslint-plugin-react#1735 is merged, then we can just
whitelist ReactModal.
ThiefMaster added a commit to indico/indico that referenced this pull request Apr 9, 2018
ThiefMaster added a commit to indico/indico that referenced this pull request May 7, 2018
Until jsx-eslint/eslint-plugin-react#1735 is merged, then we can just
whitelist ReactModal.
ThiefMaster added a commit to indico/indico that referenced this pull request May 7, 2018
ThiefMaster added a commit to indico/indico that referenced this pull request May 16, 2018
Until jsx-eslint/eslint-plugin-react#1735 is merged, then we can just
whitelist ReactModal.
ThiefMaster added a commit to indico/indico that referenced this pull request May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

forbid-component-props should have a component whitelist
2 participants