# TS1042: '…' modifier cannot be used here.

> A modifier is written somewhere it has no meaning, such as `public` on an object literal property. Remove the modifier.

## What it means

Modifiers like `public`, `static`, `readonly` or `export` only make sense on certain
declarations. This code reports one used elsewhere, for example on a property or method of an
object literal, where no modifier except `async` (on methods) is allowed.

## Example

```ts
export const point = { public x: 1 };
```

## How to fix

- Delete the modifier.
- If you wanted a class with that visibility, declare a class instead of an object literal.

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