# require-accessor-pair

Disallow setters without a matching getter

A write-only property prevents callers from observing the value represented by its setter.
Instead, you SHOULD provide a getter in the same property namespace.

Getter-only properties remain valid readonly properties.

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

## Reported

```ds title="main.ds"
interface Store {
    set value(next: string);
}
```

## Accepted

```ds title="main.ds"
interface Store {
    get value(): string;
    set value(next: string);
}
```

## Prior art

- [ESLint · accessor-pairs](https://eslint.org/docs/latest/rules/accessor-pairs)

[language/linter/src/rules/style/require_accessor_pair.rs:8](https://github.com/destack-sh/destack/blob/main/language/linter/src/rules/style/require_accessor_pair.rs#L8)
