Skip to main content

noImplicitBoolean

Disallow implicit true values on JSX boolean attributes

Examples

Invalid

<input disabled />
warning[noImplicitBoolean]: Use explicit boolean values for boolean JSX props.
   noImplicitBoolean.js:1:8
  
1  <input disabled />
          --------

Safe fix: Add explicit `true` literal for this attribute
    | @@ -1 +1 @@
0   | - <input disabled />
  0 | + <input disabled={true} />

Valid

<input disabled={false} />
<input disabled={''} />
<input disabled={0} />
<input disabled={undefined} />
<input disabled='false' />