# consistent-boolean-name

Rule `unicorn/consistent-boolean-name`. Enforce consistent naming for boolean names.

- Source: unicorn
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 9.9M weekly downloads of presets that enable it
- Trend: +28.3% last quarter
- Rank: #1016 by reach, #1271 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `unicorn/consistent-boolean-name` | no | safe | package `eslint-plugin-unicorn` | [docs](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v80.0.0/docs/rules/consistent-boolean-name.md) |
| Biome | `nursery/useConsistentBooleanName` | no | no | group nursery, since 2.6.7 | [docs](https://biomejs.dev/linter/rules/use-consistent-boolean-name/) |

## Code examples

### Incorrect: the rule reports this

```js
const completed = true;
```

```js
const hasName = 'Sindre';
```

```js
function hasTitle() {
  return 'Unicorn';
}
```

### Correct: the rule accepts this

```js
const isCompleted = true;
```

```js
const name = 'Sindre';
```

```js
function getTitle() {
  return 'Unicorn';
}
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import unicorn from "eslint-plugin-unicorn";

export default [
  {
    plugins: { unicorn },
    rules: {
      "unicorn/consistent-boolean-name": "error",
    },
  },
];
```

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "useConsistentBooleanName": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Unicorn recommended](https://lintradar.dev/presets/unicorn-recommended.md) | ESLint | `eslint-plugin-unicorn` | 340 | 9.5M | +30.3% |
| [XO](https://lintradar.dev/presets/xo.md) | ESLint | `eslint-config-xo` | 618 | 413K | −5.0% |

## Related rules

- [unicorn/no-array-callback-reference](https://lintradar.dev/rules/unicorn/no-array-callback-reference.md): Prevent passing a function reference directly to iterator methods.
- [unicorn/consistent-json-file-read](https://lintradar.dev/rules/unicorn/consistent-json-file-read.md): Enforce consistent JSON file reads before `JSON.parse()`.
- [unicorn/max-nested-calls](https://lintradar.dev/rules/unicorn/max-nested-calls.md): Limit the depth of nested calls.
- [unicorn/consistent-tuple-labels](https://lintradar.dev/rules/unicorn/consistent-tuple-labels.md): Enforce consistent labels on tuple type elements.
- [unicorn/no-null](https://lintradar.dev/rules/unicorn/no-null.md): Disallow the use of the `null` literal.
- [unicorn/default-export-style](https://lintradar.dev/rules/unicorn/default-export-style.md): Enforce consistent default export declarations.

---

Web page: https://lintradar.dev/rules/unicorn/consistent-boolean-name. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
