# TypeScript: error TS2578: Unused '@ts-expect-error' directive.

**Code:** `TS2578: Unused '@ts-expect-error' directive` · **Category:** TypeScript · **Seen on:** TypeScript

A `// @ts-expect-error` comment suppresses nothing because the next line no longer has an error.

## Meaning

Remove the directive (the code is fine now — often after a library/type fix), or move it to the right line. `@ts-expect-error` is stricter than `@ts-ignore` by design. Keep it for tests that deliberately check type errors.

## Common causes

- The error was fixed (types updated)
- Comment on the wrong line (must be directly above)
- Multi-line expressions shift the error line
- Different TypeScript version behaviour
- Conditional types resolving differently

## Quick fix

1. Delete the directive if there's no error
2. Move it directly above the offending line
3. Use `@ts-ignore` only if the error is intermittent (prefer expect-error)

## Detailed fix by platform

### TypeScript

1. 

```typescript
// @ts-expect-error: intentionally wrong type in test
foo("123");
```


## How to diagnose

1. **Error** — Still present?
2. **Placement** — Directly above?
3. **Version** — Changed?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/typescript/ts2578-unused-ts-expect-error-directive)
