TypeScript Compiler Options
noLib — TypeScript compiler option
Disables automatic standard library declaration inclusion. Supply fundamental globals when implementing a custom environment; the option does not remove runtime built-ins. Cannot be combined with lib. These minimal declarations are educational stubs, not a production library. Default in 5.8.3: false. Create the labeled files in an isolated project and run tsc -p tsconfig.json. Expected diagnostics: []. Expected emitted files: none. Local project fixture, not a single-file editor.
Formal Syntax & Structure
typescript syntaxtypescript
{ "compilerOptions": { "noLib": true }}Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| noLib | boolean | Set in compilerOptions; default in 5.8.3: false. |
Working Example
Example Snippettypescript
// File: tsconfig.json (omit this label){ "compilerOptions": { "target": "ES2022", "module": "CommonJS", "strict": true, "types": [], "noEmitOnError": true, "outDir": "dist", "noLib": true, "noEmit": true }, "files": [ "globals.d.ts", "main.ts" ]}// File: globals.d.tsinterface Array<T> {}interface Boolean {}interface CallableFunction {}interface NewableFunction {}interface Function {}interface IArguments {}interface Number {}interface Object {}interface RegExp {}interface String {}// File: main.tsconst value: number = 3;