--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: noUndeclaredVariables.ts --- # Input ```ts // valid export type EventHandler = `on${T}` export type EventHandlerDefault = `on${T}` export type NestedContext> = '' | `(${S})` export type NestedContextDefault = '' | `(${S})` export type Whatever = `Hello ${S}` export type WhateverDefault = `Hello ${S}` // Const assertions are valid const fruits = ["banana"] as const; class X { f() { this.g; type T1 = typeof this.g; type T2 = X['g']; } g() { } } // Invalid export type Invalid = `Hello ${T}` ``` # Diagnostics ``` noUndeclaredVariables.ts:26:50 lint/correctness/noUndeclaredVariables ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! The T variable is undeclared 25 │ // Invalid > 26 │ export type Invalid = `Hello ${T}` │ ^ 27 │ ```