> For AI agents: the complete documentation index is available at https://rslint.rs/llms.txt, the full documentation bundle is available at https://rslint.rs/llms-full.txt.

# jsx-boolean-value

[Added in v0.3.0](https://github.com/web-infra-dev/rslint/releases/tag/v0.3.0)
## Configuration


```ts title=rslint.config.ts
import { defineConfig, reactPlugin } from '@rslint/core';

export default defineConfig([
  reactPlugin.configs.recommended,
  {
    rules: {
      'react/jsx-boolean-value': 'error',
    },
  },
]);
```

## Rule Details

Enforce boolean attributes notation in JSX. When a prop is `true`, it can be written as either `<Foo bar />` or `<Foo bar={true} />`.

Examples of **incorrect** code with the default `"never"` option:

```jsx
<Foo bar={true} />
```

Examples of **correct** code with the default `"never"` option:

```jsx
<Foo bar />
```

## Options

- First argument: `"never"` (default) or `"always"`
  - `"never"`: Enforce shorthand (`<Foo bar />`)
  - `"always"`: Enforce explicit value (`<Foo bar={true} />`)
- Second argument (optional): An object with:
  - `"never"`: Array of prop names that should use shorthand. Only valid when first argument is `"always"`.
  - `"always"`: Array of prop names that should use explicit `={true}`. Only valid when first argument is `"never"`.
  - `"assumeUndefinedIsFalse"`: When `true`, `={false}` props are reported for removal (omitting a boolean prop is treated as `false`).

## Original Documentation

- [eslint-plugin-react: jsx-boolean-value](https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.37.5/docs/rules/jsx-boolean-value.md)
- [Source code](https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.37.5/lib/rules/jsx-boolean-value.js)
