- Sound mode general, pre-alpha
- Design record 0007, Accepted
TSR0004
Unknown level '{0}' in '@ts-r' pragma. Use 'off', 'strict', 'sound' or 'contracts'.
A '// @ts-r' pragma names an unknown level. Use 'off', 'strict', 'sound' or 'contracts'.
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
A file can set its own sound-mode level with a pragma in its leading comments: // @ts-r off, strict, sound or contracts. Any other word is reported, and the file keeps the level its configuration gives it.
Example
// @ts-r loud // @expect TSR0004
// Unknown levels are reported; the file falls back to its configured level (sound).
export const n: number = 1;
How to fix
- Use one of the four levels:
// @ts-r off,// @ts-r strict,// @ts-r sound,// @ts-r contracts. - Or remove the pragma and let
include/excludein the[sound]configuration decide.
Sound mode is defined in design record 0007 (accepted 2026-10-15).