-
-
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
Extend "jsx-boolean-value" to support optional "ignore" list #1249
Comments
why wouldn't you want to do |
Good question. I think |
It sounds like then you wouldn't want "ignore", you'd instead want a setting that enforced "always" for that prop. |
Yes, I want to use a mix of This should cause lint error <Toggle toggled={true} /> but this should pass the linting <CheckBox value={true} /> and this should cause lint error <CheckBox value /> |
Although I don't personally agree with that style, an option to the rule to allow this works. What about, only with "always", a "never" option - and only with "never", an "always" option? Both options would be a unique array of prop names. |
PR up: #1250 |
Thanks for the PR @ljharb |
It would be great if we could configure
jsx-boolean-value
to ignore a list of props.Example
This allows the following expression to be valid
And if you wonder why I'm not using a prop like
toggled
instead ofvalue
, it's because we want to have a set of components that support the same prop.I'm more than happy to support the idea with a PR.
The text was updated successfully, but these errors were encountered: