# TSR0101: Type 'any' is not allowed in sound mode. Use 'unknown', a type parameter or a specific type.

> The type 'any' is written in a sound or strict file. Use 'unknown', a type parameter or a specific type.

## What it means

In sound and strict files the type `any` may not be written anywhere: annotations, type arguments, defaults, assertions, `extends` clauses and index signatures. It's reported at the `any` keyword. `any` written in `.d.ts` files and packages is fine; it becomes `unknown` where a sound file reads it ([TSR0102](https://ts-r.dev/errors/TSR0102/)).

## Example

```ts
// Writing any in a variable annotation.
const raw: any = 1; // @expect TSR0101
export const copy: unknown = raw;
```

## How to fix

- Write `unknown` and narrow the value before using it.
- Use a type parameter where the type varies: `function f<T>(x: Record<string, T>)`.
- Write the specific type when you know it.
- The planned quick fix rewrites `any` to `unknown` and lets the follow-on errors guide the narrowing.

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/TSR0101/
