UNPKG

13.9 kBTypeScriptView Raw
1export interface RawCompilerOptions {
2 /**
3 * No longer supported. In early versions, manually set the text encoding for reading files.
4 */
5 charset?: string;
6 /**
7 * Enable constraints that allow a TypeScript project to be used with project references.
8 */
9 composite?: boolean;
10 /**
11 * Generate .d.ts files from TypeScript and JavaScript files in your project.
12 */
13 declaration?: boolean;
14 /**
15 * Specify the output directory for generated declaration files.
16 */
17 declarationDir?: string | null;
18 /**
19 * Output compiler performance information after building.
20 */
21 diagnostics?: boolean;
22 /**
23 * Reduce the number of projects loaded automatically by TypeScript.
24 */
25 disableReferencedProjectLoad?: boolean;
26 /**
27 * Enforces using indexed accessors for keys declared using an indexed type
28 */
29 noPropertyAccessFromIndexSignature?: boolean;
30 /**
31 * Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.
32 */
33 emitBOM?: boolean;
34 /**
35 * Only output d.ts files and not JavaScript files.
36 */
37 emitDeclarationOnly?: boolean;
38 /**
39 * Save .tsbuildinfo files to allow for incremental compilation of projects.
40 */
41 incremental?: boolean;
42 /**
43 * Specify the folder for .tsbuildinfo incremental compilation files.
44 */
45 tsBuildInfoFile?: string;
46 /**
47 * Include sourcemap files inside the emitted JavaScript.
48 */
49 inlineSourceMap?: boolean;
50 /**
51 * Include source code in the sourcemaps inside the emitted JavaScript.
52 */
53 inlineSources?: boolean;
54 /**
55 * Specify what JSX code is generated.
56 */
57 jsx?: 'preserve' | 'react' | 'react-jsx' | 'react-jsxdev' | 'react-native';
58 /**
59 * Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.
60 */
61 reactNamespace?: string;
62 /**
63 * Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'
64 */
65 jsxFactory?: string;
66 /**
67 * Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.
68 */
69 jsxFragmentFactory?: string;
70 /**
71 * Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.`
72 */
73 jsxImportSource?: string;
74 /**
75 * Print all of the files read during the compilation.
76 */
77 listFiles?: boolean;
78 /**
79 * Specify the location where debugger should locate map files instead of generated locations.
80 */
81 mapRoot?: string;
82 /**
83 * Specify what module code is generated.
84 */
85 module?: ('CommonJS' | 'AMD' | 'System' | 'UMD' | 'ES6' | 'ES2015' | 'ES2020' | 'ESNext' | 'None') | string;
86 /**
87 * Specify how TypeScript looks up a file from a given module specifier.
88 */
89 moduleResolution?: ('Classic' | 'Node') | string;
90 /**
91 * Set the newline character for emitting files.
92 */
93 newLine?: ('crlf' | 'lf') | string;
94 /**
95 * Disable emitting file from a compilation.
96 */
97 noEmit?: boolean;
98 /**
99 * Disable generating custom helper functions like `__extends` in compiled output.
100 */
101 noEmitHelpers?: boolean;
102 /**
103 * Disable emitting files if any type checking errors are reported.
104 */
105 noEmitOnError?: boolean;
106 /**
107 * Enable error reporting for expressions and declarations with an implied `any` type..
108 */
109 noImplicitAny?: boolean;
110 /**
111 * Enable error reporting when `this` is given the type `any`.
112 */
113 noImplicitThis?: boolean;
114 /**
115 * Enable error reporting when a local variables aren't read.
116 */
117 noUnusedLocals?: boolean;
118 /**
119 * Raise an error when a function parameter isn't read
120 */
121 noUnusedParameters?: boolean;
122 /**
123 * Disable including any library files, including the default lib.d.ts.
124 */
125 noLib?: boolean;
126 /**
127 * Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project.
128 */
129 noResolve?: boolean;
130 /**
131 * Disable strict checking of generic signatures in function types.
132 */
133 noStrictGenericChecks?: boolean;
134 /**
135 * Skip type checking .d.ts files that are included with TypeScript.
136 */
137 skipDefaultLibCheck?: boolean;
138 /**
139 * Skip type checking all .d.ts files.
140 */
141 skipLibCheck?: boolean;
142 /**
143 * Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.
144 */
145 outFile?: string;
146 /**
147 * Specify an output folder for all emitted files.
148 */
149 outDir?: string;
150 /**
151 * Disable erasing `const enum` declarations in generated code.
152 */
153 preserveConstEnums?: boolean;
154 /**
155 * Disable resolving symlinks to their realpath. This correlates to the same flag in node.
156 */
157 preserveSymlinks?: boolean;
158 /**
159 * Disable wiping the console in watch mode
160 */
161 preserveWatchOutput?: boolean;
162 /**
163 * Enable color and formatting in output to make compiler errors easier to read
164 */
165 pretty?: boolean;
166 /**
167 * Disable emitting comments.
168 */
169 removeComments?: boolean;
170 /**
171 * Specify the root folder within your source files.
172 */
173 rootDir?: string;
174 /**
175 * Ensure that each file can be safely transpiled without relying on other imports.
176 */
177 isolatedModules?: boolean;
178 /**
179 * Create source map files for emitted JavaScript files.
180 */
181 sourceMap?: boolean;
182 /**
183 * Specify the root path for debuggers to find the reference source code.
184 */
185 sourceRoot?: string;
186 /**
187 * Disable reporting of excess property errors during the creation of object literals.
188 */
189 suppressExcessPropertyErrors?: boolean;
190 /**
191 * Suppress `noImplicitAny` errors when indexing objects that lack index signatures.
192 */
193 suppressImplicitAnyIndexErrors?: boolean;
194 /**
195 * Set the JavaScript language version for emitted JavaScript and include compatible library declarations.
196 */
197 target?: ('ES3' | 'ES5' | 'ES6' | 'ES2015' | 'ES2016' | 'ES2017' | 'ES2018' | 'ES2019' | 'ES2020' | 'ESNext') | string;
198 /**
199 * Watch input files.
200 */
201 watch?: boolean;
202 /**
203 * Specify what approach the watcher should use if the system runs out of native file watchers.
204 */
205 fallbackPolling?: 'fixedPollingInterval' | 'priorityPollingInterval' | 'dynamicPriorityPolling';
206 /**
207 * Specify how directories are watched on systems that lack recursive file-watching functionality.
208 */
209 watchDirectory?: 'useFsEvents' | 'fixedPollingInterval' | 'dynamicPriorityPolling';
210 /**
211 * Specify how the TypeScript watch mode works.
212 */
213 watchFile?: 'fixedPollingInterval' | 'priorityPollingInterval' | 'dynamicPriorityPolling' | 'useFsEvents' | 'useFsEventsOnParentDirectory';
214 /**
215 * Enable experimental support for TC39 stage 2 draft decorators.
216 */
217 experimentalDecorators?: boolean;
218 /**
219 * Emit design-type metadata for decorated declarations in source files.
220 */
221 emitDecoratorMetadata?: boolean;
222 /**
223 * Disable error reporting for unused labels.
224 */
225 allowUnusedLabels?: boolean;
226 /**
227 * Enable error reporting for codepaths that do not explicitly return in a function.
228 */
229 noImplicitReturns?: boolean;
230 /**
231 * Add `undefined` to a type when accessed using an index.
232 */
233 noUncheckedIndexedAccess?: boolean;
234 /**
235 * Enable error reporting for fallthrough cases in switch statements.
236 */
237 noFallthroughCasesInSwitch?: boolean;
238 /**
239 * Disable error reporting for unreachable code.
240 */
241 allowUnreachableCode?: boolean;
242 /**
243 * Ensure that casing is correct in imports.
244 */
245 forceConsistentCasingInFileNames?: boolean;
246 /**
247 * Emit a v8 CPU profile of the compiler run for debugging.
248 */
249 generateCpuProfile?: string;
250 /**
251 * Specify the base directory to resolve non-relative module names.
252 */
253 baseUrl?: string;
254 /**
255 * Specify a set of entries that re-map imports to additional lookup locations.
256 */
257 paths?: {
258 [k: string]: string[];
259 };
260 /**
261 * Specify a list of language service plugins to include.
262 */
263 plugins?: Array<{
264 /**
265 * Plugin name.
266 */
267 name?: string;
268 [k: string]: unknown;
269 }>;
270 /**
271 * Allow multiple folders to be treated as one when resolving modules.
272 */
273 rootDirs?: string[];
274 /**
275 * Specify multiple folders that act like `./node_modules/@types`.
276 */
277 typeRoots?: string[];
278 /**
279 * Specify type package names to be included without being referenced in a source file.
280 */
281 types?: string[];
282 /**
283 * Log paths used during the `moduleResolution` process.
284 */
285 traceResolution?: boolean;
286 /**
287 * Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.
288 */
289 allowJs?: boolean;
290 /**
291 * Disable truncating types in error messages.
292 */
293 noErrorTruncation?: boolean;
294 /**
295 * Allow 'import x from y' when a module doesn't have a default export.
296 */
297 allowSyntheticDefaultImports?: boolean;
298 /**
299 * Disable adding 'use strict' directives in emitted JavaScript files.
300 */
301 noImplicitUseStrict?: boolean;
302 /**
303 * Print the names of emitted files after a compilation.
304 */
305 listEmittedFiles?: boolean;
306 /**
307 * Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.
308 */
309 disableSizeLimit?: boolean;
310 /**
311 * Specify a set of bundled library declaration files that describe the target runtime environment.
312 */
313 lib?: Array<('ES5' | 'ES6' | 'ES2015' | 'ES2015.Collection' | 'ES2015.Core' | 'ES2015.Generator' | 'ES2015.Iterable' | 'ES2015.Promise' | 'ES2015.Proxy' | 'ES2015.Reflect' | 'ES2015.Symbol.WellKnown' | 'ES2015.Symbol' | 'ES2016' | 'ES2016.Array.Include' | 'ES2017' | 'ES2017.Intl' | 'ES2017.Object' | 'ES2017.SharedMemory' | 'ES2017.String' | 'ES2017.TypedArrays' | 'ES2018' | 'ES2018.AsyncGenerator' | 'ES2018.AsyncIterable' | 'ES2018.Intl' | 'ES2018.Promise' | 'ES2018.Regexp' | 'ES2019' | 'ES2019.Array' | 'ES2019.Object' | 'ES2019.String' | 'ES2019.Symbol' | 'ES2020' | 'ES2020.BigInt' | 'ES2020.Promise' | 'ES2020.String' | 'ES2020.Symbol.WellKnown' | 'ESNext' | 'ESNext.Array' | 'ESNext.AsyncIterable' | 'ESNext.BigInt' | 'ESNext.Intl' | 'ESNext.Promise' | 'ESNext.String' | 'ESNext.Symbol' | 'DOM' | 'DOM.Iterable' | 'ScriptHost' | 'WebWorker' | 'WebWorker.ImportScripts') | string>;
314 /**
315 * When type checking, take into account `null` and `undefined`.
316 */
317 strictNullChecks?: boolean;
318 /**
319 * Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.
320 */
321 maxNodeModuleJsDepth?: number;
322 /**
323 * Allow importing helper functions from tslib once per project, instead of including them per-file.
324 */
325 importHelpers?: boolean;
326 /**
327 * Specify emit/checking behavior for imports that are only used for types.
328 */
329 importsNotUsedAsValues?: 'remove' | 'preserve' | 'error';
330 /**
331 * Ensure 'use strict' is always emitted.
332 */
333 alwaysStrict?: boolean;
334 /**
335 * Enable all strict type checking options.
336 */
337 strict?: boolean;
338 /**
339 * Check that the arguments for `bind`, `call`, and `apply` methods match the original function.
340 */
341 strictBindCallApply?: boolean;
342 /**
343 * Emit more compliant, but verbose and less performant JavaScript for iteration.
344 */
345 downlevelIteration?: boolean;
346 /**
347 * Enable error reporting in type-checked JavaScript files.
348 */
349 checkJs?: boolean;
350 /**
351 * When assigning functions, check to ensure parameters and the return values are subtype-compatible.
352 */
353 strictFunctionTypes?: boolean;
354 /**
355 * Check for class properties that are declared but not set in the constructor.
356 */
357 strictPropertyInitialization?: boolean;
358 /**
359 * Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.
360 */
361 esModuleInterop?: boolean;
362 /**
363 * Allow accessing UMD globals from modules.
364 */
365 allowUmdGlobalAccess?: boolean;
366 /**
367 * Make keyof only return strings instead of string, numbers or symbols. Legacy option.
368 */
369 keyofStringsOnly?: boolean;
370 /**
371 * Emit ECMAScript-standard-compliant class fields.
372 */
373 useDefineForClassFields?: boolean;
374 /**
375 * Create sourcemaps for d.ts files.
376 */
377 declarationMap?: boolean;
378 /**
379 * Enable importing .json files
380 */
381 resolveJsonModule?: boolean;
382 /**
383 * Have recompiles in projects that use `incremental` and `watch` mode assume that changes within a file will only affect files directly depending on it.
384 */
385 assumeChangesOnlyAffectDirectDependencies?: boolean;
386 /**
387 * Output more detailed compiler performance information after building.
388 */
389 extendedDiagnostics?: boolean;
390 /**
391 * Print names of files that are part of the compilation and then stop processing.
392 */
393 listFilesOnly?: boolean;
394 /**
395 * Disable preferring source files instead of declaration files when referencing composite projects
396 */
397 disableSourceOfProjectReferenceRedirect?: boolean;
398 /**
399 * Opt a project out of multi-project reference checking when editing.
400 */
401 disableSolutionSearching?: boolean;
402 [k: string]: unknown;
403}