- Sound mode S-12, pre-alpha
- Design record 0007, Accepted
TSR1204
Global augmentation in a sound file changes types for the whole program without a check. Move it to a '.d.ts' file.
'declare global' or a global merge from a script file in a sound file changes types program-wide. Move it to a .d.ts file.
Rule S-12: No suppression comments, overload implementations or global augmentation (level: sound). Reported by ts-r-check and ts-r-lsp in files that opt in to sound mode. See Sound mode.
What it means
declare global { ... } and global declarations merged from a script file (such as interface Array<T> { ... } at the top level of a non-module file) change types for the whole program without a check. In a sound file they are reported at global, or at the merged declaration's name.
Example
// Global augmentation changes types for the whole program.
declare global { // @expect TSR1204
interface Window {
tsrFixtureState?: string;
}
}
export {};
How to fix
- Move the
declare globalblock into a project.d.tsfile.
Sound mode is defined in design record 0007 (accepted 2026-10-15).