• Sound mode general, pre-alpha
  • Design record 0007, Accepted

TSR0002

Unused '@ts-r-unsafe' directive: the next line has no sound-mode error.

A '@ts-r-unsafe' escape hatch suppresses nothing because the next line has no sound-mode error. Delete it.

Rule general: Escape hatches, pragmas and configuration. Reported by ts-r-check and ts-r-lsp in files that opt in to sound mode. See Sound mode.

What it means

An escape hatch that suppresses nothing is reported so hatches can't outlive the code they excuse. A hatch with its own error (TSR0001 or TSR0003) suppresses nothing and isn't also reported as unused.

Example

Spec case from design record 0007 (checked by the record's case harness, not by this site's build)
// A hatch on a line with no sound-mode error.
// @ts-r-unsafe S-03: kept from an old version of this code. // @expect TSR0002
const n: number = 1;
export { n };

How to fix

  • Delete the directive.
  • If the error it was for moved, move the directive to the line before it.

Sound mode is defined in design record 0007 (accepted 2026-10-15).