# TSR0005: The '@ts-r' pragma must come before the first statement; this one is ignored.

> A '// @ts-r' level pragma appears after the first statement and is ignored. Move it to the top of the file.

## What it means

A file's level pragma is read only from the leading comments, before the first statement. A pragma further down is ignored, and this diagnostic says so.

## Example

```ts
// The pragma has to come before the first statement.
export const n: number = 1;
// @ts-r off // @expect TSR0005
```

## How to fix

- Move the pragma to the top of the file, above the imports.

Sound mode is defined in [design record 0007](https://github.com/Webb-Ventures/typescript-rust/blob/main/docs/design/0007-sound-mode.md) (accepted 2026-10-15).

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