# TS1497: Expression must be enclosed in parentheses to be used as a decorator.

> A decorator expression is more than a name, property access or call. Wrap the expression in parentheses.

## What it means

Decorators only accept a simple form: `@name`, `@a.b.c` or a call like `@factory()`.
Anything else, such as an element access or a call on a computed value, must be put in
parentheses.

## Example

```ts
declare const registry:
  | { service(target: unknown, context: ClassDecoratorContext): void }
  | undefined;

@registry?.service
export class Service {}
```

## How to fix

- Wrap it: `@(registry?.service)`, or narrow first and use a plain name.

Source: https://ts-r.dev/errors/TS1497/
