noImplicitBoolean
Summary
Section titled “Summary”- Rule available since:
v1.0.0 - Diagnostic Category:
lint/style/noImplicitBoolean - This rule has a safe fix.
- The default severity of this rule is information.
- Sources:
- Inspired from
react/jsx-boolean-value
- Inspired from
How to configure
Section titled “How to configure”{ "linter": { "rules": { "style": { "noImplicitBoolean": "error" } } }}Description
Section titled “Description”Disallow implicit true values on JSX boolean attributes
Examples
Section titled “Examples”Invalid
Section titled “Invalid”<input disabled />code-block.jsx:1:8 lint/style/noImplicitBoolean FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Use explicit boolean values for boolean JSX props.
> 1 │ <input disabled />
│ ^^^^^^^^
2 │
ℹ Safe fix: Add explicit true literal for this attribute
1 │ <input·disabled={true}·/>
│ +++++++
<input disabled={false} /><input disabled={''} /><input disabled={0} /><input disabled={undefined} /><input disabled='false' />Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.