Skip to content

react/jsx-boolean-value Style

🛠️ An auto-fix is available for this rule.

What it does

Enforce a consistent boolean attribute style in your code.

Why is this bad?

In JSX, you can set a boolean attribute to true or omit it. This rule will enforce a consistent style for boolean attributes.

Example

Examples of incorrect code for this rule:

jsx
const Hello = <Hello personal={true} />;

Examples of correct code for this rule:

jsx
const Hello = <Hello personal />;

References

Released under the MIT License.