# object-shorthand

Require object property shorthand where equivalent

`{ value: value }` repeats one name for the object key and its referenced binding and is equivalent to `{ value }`.
Instead, you SHOULD use property shorthand.

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

## Reported

```ds title="main.ds"
function point(x: int32): { x: int32 } {
    return { x: x };
}
```

## Accepted

```ds title="main.ds"
function point(x: int32): { x: int32 } {
    return { x };
}
```

## Prior art

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

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