Skip to content

booleanValues

Prefer shorthand boolean attributes over explicit {true} values in JSX.

✅ This rule is included in the jsx stylistic presets.

When a boolean JSX attribute is set to true, the value can be omitted entirely. The shorthand syntax is more concise and idiomatic in JSX, reducing visual noise and improving readability.

<
any
button
disabled: boolean
disabled
={true}>Click me</
any
button
>
<
any
input
type: string
type
="text"
required: boolean
required
={true} />
<
const Component: React.FC
Component
isActive: boolean
isActive
={true} />;

This rule is not configurable.

If your project has an established style guide that prefers explicit boolean values for consistency or clarity, you may want to disable this rule. However, the shorthand syntax is widely accepted as idiomatic JSX.

Made with ❤️‍🔥 around the world by the Flint team and contributors.