Documentation
Rules
avoid-shorthand-boolean

avoid-shorthand-boolean

Rule category

Style.

What it does

Enforces the use of explicit boolean values for boolean attributes.

Examples

Failing

import React from "react";
 
function Example() {
  return <button disabled />;
  //             ^^^^^^^^
  //             - Avoid using shorthand syntax for 'disabled' attribute.
}

Passing

import React from "react";
 
function Example() {
  return <button disabled={true} />;
}