TypeScript Compiler Options
checkJs — TypeScript compiler option
Reports semantic diagnostics in included JavaScript; implies allowJs unless explicitly disabled. File-level @ts-check or @ts-nocheck can override checking. Does not add runtime type checks. Default (5.8.3): false. Create the labeled files in an isolated project and run tsc -p tsconfig.json. No diagnostics; output: none. Local project fixture, not a single-file editor.
Formal Syntax & Structure
typescript syntaxtypescript
{ "compilerOptions": { "checkJs": true }}Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| checkJs | boolean | Set in compilerOptions; default: false. |
Working Example
Example Snippettypescript
// File: tsconfig.json (omit this label){ "compilerOptions": { "target": "ES2022", "module": "CommonJS", "strict": true, "types": [], "noEmitOnError": true, "noEmit": true, "checkJs": true }, "files": [ "legacy.js" ]}// File: legacy.js/** @type {number} */const count = 2;