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

📎 Implement useImplicitBoolean #5095

Open
dyc3 opened this issue Feb 11, 2025 · 1 comment
Open

📎 Implement useImplicitBoolean #5095

dyc3 opened this issue Feb 11, 2025 · 1 comment
Labels
S-Needs discussion Status: needs a discussion to understand criteria

Comments

@dyc3
Copy link
Contributor

dyc3 commented Feb 11, 2025

Description

Add useImplicitBoolean, a rule that enforces using implicit booleans in JSX over explicit boolean props.

Valid

<Foo bar />
<Foo bar={false} />

Invalid

<Foo bar={true} />

Requested here: #3 (comment)

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

Note that we already have noImplicitBoolean, the opposite of this rule. Would it be worth it to combine them into one rule? The best time to do so would be before 2.0.

@dyc3 dyc3 added the S-Needs discussion Status: needs a discussion to understand criteria label Feb 11, 2025
@arendjr
Copy link
Contributor

arendjr commented Feb 12, 2025

useConsistentBooleanProps with values implicit and explicit?

I don’t really like that noExplicitBoolean has no reference in its name that it’s for use with JSX; it sounds like something TypeScript-specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Needs discussion Status: needs a discussion to understand criteria
Projects
None yet
Development

No branches or pull requests

2 participants