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

Enforce (or not) boolean property with react/jsx-boolean-value #26

Open
marlomgirardi opened this issue Nov 4, 2019 · 4 comments
Open

Comments

@marlomgirardi
Copy link

WDYT about this rule?

https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md

As talked with @lfac-pt, at Pulse the common usage is <Comp prop={true} />.

@marlomgirardi marlomgirardi changed the title Enforce explicit boolean property with react/jsx-boolean-value Enforce (or not) boolean property with react/jsx-boolean-value Nov 4, 2019
@JoaoTMDias
Copy link

IMO, I think the true prop should be enforced - since it is easier to understand.
And I also think the same prop with a false value should be omitted if there's no need to pass that (meaning it's the default value).

On the other hand, having only the prop name without true/false values can come as simpler to read.

@nancruz
Copy link

nancruz commented Nov 11, 2019

IMO I think we should always enforce the boolean property. It is more explicit.

@lfac-pt
Copy link
Member

lfac-pt commented Nov 11, 2019

@marlomgirardi do you want to do a pr with this then?

@AndreTecFil1991
Copy link

I also agree with enforcing boolean values. It is shorter to their values omitted but sometimes is not clear without having it explicit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants