# boolean-prefix

Require predicate prefixes for boolean values

A boolean value represents a predicate, but an unprefixed name does not identify it as one at use sites.
Instead, you SHOULD begin boolean bindings, parameters, fields, and constants with `is`, `has`, `can`, `should`, `did`, or `will`.

Functions and methods are exempt because verbs such as `contains`, `matches`, and `startsWith` already express a predicate.

- Category: style
- Level: warning
- Fix: none
- Scope: module

## Reported

```ds title="main.ds"
function send(ready: boolean): void {}
```

## Accepted

```ds title="main.ds"
function send(isReady: boolean): void {}
```

## Prior art

- [eslint-plugin-unicorn · consistent-boolean-name](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-boolean-name.md)

[language/linter/src/rules/style/boolean_prefix.rs:9](https://github.com/destack-sh/destack/blob/main/language/linter/src/rules/style/boolean_prefix.rs#L9)
