typescript_config/lib.rs
1use merge_it::*;
2#[cfg(feature = "schemars")]
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5use serde_json::Value;
6use std::collections::{BTreeMap, BTreeSet};
7use std::fmt::Display;
8
9mod tsconfig_elements;
10
11pub use tsconfig_elements::*;
12
13type JsonValueBTreeMap = BTreeMap<String, Value>;
14
15/// Settings for the watch mode in TypeScript.
16#[derive(Deserialize, Debug, Clone, Serialize, PartialEq, Eq, Merge)]
17#[cfg_attr(feature = "schemars", derive(JsonSchema))]
18#[serde(rename_all = "camelCase")]
19#[serde(deny_unknown_fields)]
20pub struct WatchOptions {
21 /// Specify how the TypeScript watch mode works.
22 ///
23 /// See more: https://www.typescriptlang.org/tsconfig#watchFile
24 #[serde(skip_serializing_if = "Option::is_none")]
25 pub watch_file: Option<WatchFile>,
26
27 /// Specify how directories are watched on systems that lack recursive file-watching functionality.
28 ///
29 /// See more: https://www.typescriptlang.org/tsconfig#watchDirectory
30 #[serde(skip_serializing_if = "Option::is_none")]
31 pub watch_directory: Option<WatchDirectory>,
32
33 /// Remove a list of files from the watch mode's processing.
34 ///
35 /// See more: https://www.typescriptlang.org/tsconfig#excludeFiles
36 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
37 pub exclude_files: BTreeSet<String>,
38
39 /// Remove a list of directories from the watch process.
40 ///
41 /// See more: https://www.typescriptlang.org/tsconfig#excludeDirectories
42 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
43 pub exclude_directories: BTreeSet<String>,
44
45 /// Specify what approach the watcher should use if the system runs out of native file watchers.
46 ///
47 /// See more: https://www.typescriptlang.org/tsconfig#fallbackPolling
48 #[serde(skip_serializing_if = "Option::is_none")]
49 pub fallback_polling: Option<FallbackPolling>,
50
51 /// Synchronously call callbacks and update the state of directory watchers on platforms that don`t support recursive watching natively.
52 ///
53 /// See more: https://www.typescriptlang.org/tsconfig#synchronousWatchDirectory
54 #[serde(skip_serializing_if = "Option::is_none")]
55 pub synchronous_watch_directory: Option<bool>,
56}
57
58/// A struct representing the contents of a `tsconfig.json` file.
59#[derive(Deserialize, Debug, Clone, Serialize, Default, Merge, PartialEq, Eq)]
60#[cfg_attr(feature = "schemars", derive(JsonSchema))]
61#[serde(rename_all = "camelCase")]
62#[serde(default)]
63pub struct TsConfig {
64 /// Path to base configuration file to inherit from (requires TypeScript version 2.1 or later), or array of base files, with the rightmost files having the greater priority (requires TypeScript version 5.0 or later).
65 #[serde(skip_serializing_if = "Option::is_none")]
66 pub extends: Option<String>,
67
68 /// If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. When a 'files' property is specified, only those files and those specified by 'include' are included.
69 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
70 pub files: BTreeSet<String>,
71
72 /// Specifies a list of files to be excluded from compilation. The 'exclude' property only affects the files included via the 'include' property and not the 'files' property. Glob patterns require TypeScript version 2.0 or later.
73 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
74 pub exclude: BTreeSet<String>,
75
76 /// Specifies a list of glob patterns that match files to be included in compilation. If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. Requires TypeScript version 2.0 or later.
77 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
78 pub include: BTreeSet<String>,
79
80 /// Referenced projects. Requires TypeScript version 3.0 or later.
81 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
82 pub references: BTreeSet<TsConfigReference>,
83
84 /// Auto type (.d.ts) acquisition options for this project. Requires TypeScript version 2.1 or later.
85 #[serde(skip_serializing_if = "Option::is_none")]
86 pub type_acquisition: Option<TypeAcquisition>,
87
88 /// Settings for the watch mode in TypeScript.
89 #[serde(skip_serializing_if = "Option::is_none")]
90 pub watch_options: Option<WatchOptions>,
91
92 /// Instructs the TypeScript compiler how to compile .ts files.
93 #[serde(skip_serializing_if = "Option::is_none")]
94 #[merge(with = merge_options)]
95 pub compiler_options: Option<CompilerOptions>,
96}
97
98/// Auto type (.d.ts) acquisition options for this project. Requires TypeScript version 2.1 or later.
99#[derive(Deserialize, Debug, Clone, Serialize, PartialEq, Eq)]
100#[cfg_attr(feature = "schemars", derive(JsonSchema))]
101#[serde(untagged)]
102pub enum TypeAcquisition {
103 Bool(bool),
104 Object {
105 /// Enable auto type acquisition
106 enable: bool,
107 /// Specifies a list of type declarations to be included in auto type acquisition. Ex. ["jquery", "lodash"]
108 include: Option<BTreeSet<String>>,
109 /// Specifies a list of type declarations to be excluded from auto type acquisition. Ex. ["jquery", "lodash"]
110 exclude: Option<BTreeSet<String>>,
111
112 /// TypeScript’s type acquisition can infer what types should be added based on filenames in a project. This means that having a file like jquery.js in your project would automatically download the types for JQuery from DefinitelyTyped.
113 /// You can disable this via disableFilenameBasedTypeAcquisition.
114 ///
115 /// See more: https://www.typescriptlang.org/it/tsconfig/#type-disableFilenameBasedTypeAcquisition
116 #[serde(rename = "disableFilenameBasedTypeAcquisition")]
117 disable_filename_based_type_acquisition: Option<bool>,
118 },
119}
120
121/// Instructs the TypeScript compiler how to compile .ts files.
122#[derive(Deserialize, Serialize, Debug, Clone, Default, Merge, PartialEq, Eq)]
123#[cfg_attr(feature = "schemars", derive(JsonSchema))]
124#[serde(rename_all = "camelCase")]
125#[serde(default)]
126#[serde(deny_unknown_fields)]
127pub struct CompilerOptions {
128 /// Enable importing files with any extension, provided a declaration file is present.
129 ///
130 /// See more: https://www.typescriptlang.org/tsconfig#allowArbitraryExtensions
131 #[serde(skip_serializing_if = "Option::is_none")]
132 pub allow_arbitrary_extensions: Option<bool>,
133
134 /// Allow imports to include TypeScript file extensions. Requires either '--noEmit' or '--emitDeclarationOnly' to be set.
135 ///
136 /// See more: https://www.typescriptlang.org/tsconfig#allowImportingTsExtensions
137 #[serde(skip_serializing_if = "Option::is_none")]
138 pub allow_importing_ts_extensions: Option<bool>,
139
140 /// Allow JavaScript files to be imported inside your project, instead of just .ts and .tsx files.
141 ///
142 /// See more: https://www.typescriptlang.org/tsconfig/#allowJs
143 #[serde(skip_serializing_if = "Option::is_none")]
144 pub allow_js: Option<bool>,
145
146 /// Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.
147 ///
148 /// See more: https://www.typescriptlang.org/tsconfig#esModuleInterop
149 #[serde(skip_serializing_if = "Option::is_none")]
150 pub allow_synthetic_default_imports: Option<bool>,
151
152 /// Allow accessing UMD globals from modules.
153 ///
154 /// See more: https://www.typescriptlang.org/tsconfig#allowUmdGlobalAccess
155 #[serde(skip_serializing_if = "Option::is_none")]
156 pub allow_umd_global_access: Option<bool>,
157
158 /// Disable error reporting for unreachable code.
159 ///
160 /// See more: https://www.typescriptlang.org/tsconfig#allowUnreachableCode
161 #[serde(skip_serializing_if = "Option::is_none")]
162 pub allow_unreachable_code: Option<bool>,
163
164 /// Disable error reporting for unused labels.
165 ///
166 /// See more: https://www.typescriptlang.org/tsconfig#allowUnusedLabels
167 #[serde(skip_serializing_if = "Option::is_none")]
168 pub allow_unused_labels: Option<bool>,
169
170 /// Ensures that your files are parsed in the ECMAScript strict mode, and emit “use strict” for each source file.
171 ///
172 /// See more: https://www.typescriptlang.org/tsconfig/#alwaysStrict
173 #[serde(skip_serializing_if = "Option::is_none")]
174 pub always_strict: Option<bool>,
175
176 /// Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it. Requires TypeScript version 3.8 or later.
177 ///
178 /// See more: https://www.typescriptlang.org/tsconfig/#assumeChangesOnlyAffectDirectDependencies
179 #[serde(skip_serializing_if = "Option::is_none")]
180 pub assume_changes_only_affect_direct_dependencies: Option<bool>,
181
182 /// Specify the base directory to resolve non-relative module names.
183 ///
184 /// See more: https://www.typescriptlang.org/tsconfig#baseUrl
185 #[serde(skip_serializing_if = "Option::is_none")]
186 pub base_url: Option<String>,
187
188 /// Enable error reporting in type-checked JavaScript files.
189 ///
190 /// See more: https://www.typescriptlang.org/tsconfig#checkJs
191 #[serde(skip_serializing_if = "Option::is_none")]
192 pub check_js: Option<bool>,
193
194 /// Enable constraints that allow a TypeScript project to be used with project references.
195 ///
196 /// See more: https://www.typescriptlang.org/tsconfig#composite
197 #[serde(skip_serializing_if = "Option::is_none")]
198 pub composite: Option<bool>,
199
200 /// Conditions to set in addition to the resolver-specific defaults when resolving imports.
201 ///
202 /// See more: https://www.typescriptlang.org/tsconfig#customConditions
203 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
204 pub custom_conditions: BTreeSet<String>,
205
206 /// Generate .d.ts files from TypeScript and JavaScript files in your project.
207 ///
208 /// See more: https://www.typescriptlang.org/tsconfig#declaration
209 #[serde(skip_serializing_if = "Option::is_none")]
210 pub declaration: Option<bool>,
211
212 /// Specify the output directory for generated declaration files.
213 ///
214 /// See more: https://www.typescriptlang.org/tsconfig#declarationDir
215 #[serde(skip_serializing_if = "Option::is_none")]
216 pub declaration_dir: Option<String>,
217
218 /// Create sourcemaps for d.ts files.
219 ///
220 /// See more: https://www.typescriptlang.org/tsconfig#declarationMap
221 #[serde(skip_serializing_if = "Option::is_none")]
222 pub declaration_map: Option<bool>,
223
224 /// Reduce the number of projects loaded automatically by TypeScript.
225 ///
226 /// See more: https://www.typescriptlang.org/tsconfig#disableReferencedProjectLoad
227 #[serde(skip_serializing_if = "Option::is_none")]
228 pub disable_referenced_project_load: Option<bool>,
229
230 /// Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.
231 ///
232 /// See more: https://www.typescriptlang.org/tsconfig#disableSizeLimit
233 #[serde(skip_serializing_if = "Option::is_none")]
234 pub disable_size_limit: Option<bool>,
235
236 /// Opt a project out of multi-project reference checking when editing.
237 ///
238 /// See more: https://www.typescriptlang.org/tsconfig#disableSolutionSearching
239 #[serde(skip_serializing_if = "Option::is_none")]
240 pub disable_solution_searching: Option<bool>,
241
242 /// Disable preferring source files instead of declaration files when referencing composite projects.
243 ///
244 /// See more: https://www.typescriptlang.org/tsconfig#disableSourceOfProjectReferenceRedirect
245 #[serde(skip_serializing_if = "Option::is_none")]
246 pub disable_source_of_project_reference_redirect: Option<bool>,
247
248 /// Emit more compliant, but verbose and less performant JavaScript for iteration.
249 ///
250 /// See more: https://www.typescriptlang.org/tsconfig#downlevelIteration
251 #[serde(skip_serializing_if = "Option::is_none")]
252 pub downlevel_iteration: Option<bool>,
253
254 /// Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.
255 ///
256 /// See more: https://www.typescriptlang.org/tsconfig#emitBOM
257 #[serde(skip_serializing_if = "Option::is_none")]
258 #[serde(rename = "emitBOM")]
259 pub emit_bom: Option<bool>,
260
261 /// Only output d.ts files and not JavaScript files.
262 ///
263 /// See more: https://www.typescriptlang.org/tsconfig#emitDeclarationOnly
264 #[serde(skip_serializing_if = "Option::is_none")]
265 pub emit_declaration_only: Option<bool>,
266
267 /// Emit design-type metadata for decorated declarations in source files.
268 ///
269 /// See more: https://www.typescriptlang.org/tsconfig#emitDecoratorMetadata
270 #[serde(skip_serializing_if = "Option::is_none")]
271 pub emit_decorator_metadata: Option<bool>,
272
273 /// Do not allow runtime constructs that are not part of ECMAScript.
274 ///
275 /// See more: https://www.typescriptlang.org/tsconfig#erasableSyntaxOnly
276 #[serde(skip_serializing_if = "Option::is_none")]
277 pub erasable_syntax_only: Option<bool>,
278
279 /// Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.
280 ///
281 /// See more: https://www.typescriptlang.org/tsconfig#esModuleInterop
282 #[serde(skip_serializing_if = "Option::is_none")]
283 pub es_module_interop: Option<bool>,
284
285 /// Differentiate between undefined and not present when type checking.
286 ///
287 /// See more: https://www.typescriptlang.org/tsconfig#exactOptionalPropertyTypes
288 #[serde(skip_serializing_if = "Option::is_none")]
289 pub exact_optional_property_types: Option<bool>,
290
291 /// Output more detailed compiler performance information after building.
292 ///
293 /// See more: https://www.typescriptlang.org/tsconfig#extendedDiagnostics
294 #[serde(skip_serializing_if = "Option::is_none")]
295 pub extended_diagnostics: Option<bool>,
296
297 /// Enable experimental support for TC39 stage 2 draft decorators.
298 ///
299 /// See more: https://www.typescriptlang.org/tsconfig#experimentalDecorators
300 #[serde(skip_serializing_if = "Option::is_none")]
301 pub experimental_decorators: Option<bool>,
302
303 /// Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation.
304 ///
305 /// See more: https://www.typescriptlang.org/tsconfig/#explainFiles
306 #[serde(skip_serializing_if = "Option::is_none")]
307 pub explain_files: Option<bool>,
308
309 /// Ensure that casing is correct in imports.
310 ///
311 /// See more: https://www.typescriptlang.org/tsconfig#forceConsistentCasingInFileNames
312 #[serde(skip_serializing_if = "Option::is_none")]
313 pub force_consistent_casing_in_file_names: Option<bool>,
314
315 /// Generates an event trace and a list of types.
316 ///
317 /// See more: https://www.typescriptlang.org/tsconfig/#generateTrace
318 #[serde(skip_serializing_if = "Option::is_none")]
319 pub generate_trace: Option<bool>,
320
321 /// Specify what JSX code is generated.
322 ///
323 /// See more: https://www.typescriptlang.org/tsconfig/#jsx
324 #[serde(skip_serializing_if = "Option::is_none")]
325 pub jsx: Option<Jsx>,
326
327 /// Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'.
328 ///
329 /// See more: https://www.typescriptlang.org/tsconfig#jsxFactory
330 #[serde(skip_serializing_if = "Option::is_none")]
331 pub jsx_factory: Option<String>,
332
333 /// Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.
334 ///
335 /// See more: https://www.typescriptlang.org/tsconfig#jsxFragmentFactory
336 #[serde(skip_serializing_if = "Option::is_none")]
337 pub jsx_fragment_factory: Option<String>,
338
339 /// Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx`.
340 ///
341 /// See more: https://www.typescriptlang.org/tsconfig#jsxImportSource
342 #[serde(skip_serializing_if = "Option::is_none")]
343 pub jsx_import_source: Option<String>,
344
345 /// Specify a set of bundled library declaration files that describe the target runtime environment.
346 ///
347 /// See more: https://www.typescriptlang.org/tsconfig#lib
348 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
349 pub lib: BTreeSet<Lib>,
350
351 /// Enable lib replacement.
352 ///
353 /// See more: https://www.typescriptlang.org/tsconfig#libReplacement
354 #[serde(skip_serializing_if = "Option::is_none")]
355 pub lib_replacement: Option<bool>,
356
357 /// Print names of generated files part of the compilation to the terminal.
358 ///
359 /// See more: https://www.typescriptlang.org/tsconfig/#listEmittedFiles
360 #[serde(skip_serializing_if = "Option::is_none")]
361 pub list_emitted_files: Option<bool>,
362
363 /// Print all of the files read during the compilation.
364 ///
365 /// See more: https://www.typescriptlang.org/tsconfig#listFiles
366 #[serde(skip_serializing_if = "Option::is_none")]
367 pub list_files: Option<bool>,
368
369 /// Specify the location where debugger should locate map files instead of generated locations.
370 ///
371 /// See more: https://www.typescriptlang.org/tsconfig#mapRoot
372 #[serde(skip_serializing_if = "Option::is_none")]
373 pub map_root: Option<String>,
374
375 /// Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`.
376 ///
377 /// See more: https://www.typescriptlang.org/tsconfig#maxNodeModuleJsDepth
378 #[serde(skip_serializing_if = "Option::is_none")]
379 pub max_node_module_js_depth: Option<u32>,
380
381 /// Specify what module code is generated.
382 ///
383 /// See more: https://www.typescriptlang.org/tsconfig#module
384 #[serde(skip_serializing_if = "Option::is_none")]
385 pub module: Option<Module>,
386
387 /// Specify how TypeScript determine a file as module.
388 ///
389 /// See more: https://www.typescriptlang.org/tsconfig/#moduleDetection
390 #[serde(skip_serializing_if = "Option::is_none")]
391 pub module_detection: Option<ModuleDetection>,
392
393 /// Provides a way to override the default list of file name suffixes to search when resolving a module.
394 ///
395 /// See more: https://www.typescriptlang.org/tsconfig/#moduleSuffixes
396 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
397 pub module_suffixes: BTreeSet<String>,
398
399 /// Log paths used during the `moduleResolution` process.
400 ///
401 /// See more: https://www.typescriptlang.org/tsconfig#traceResolution
402 #[serde(skip_serializing_if = "Option::is_none")]
403 pub module_resolution: Option<ModuleResolution>,
404
405 /// Set the newline character for emitting files.
406 ///
407 /// See more: https://www.typescriptlang.org/tsconfig#newLine
408 #[serde(skip_serializing_if = "Option::is_none")]
409 pub new_line: Option<NewLine>,
410
411 /// Disable full type checking (only critical parse and emit errors will be reported).
412 ///
413 /// See more: https://www.typescriptlang.org/tsconfig#noCheck
414 #[serde(skip_serializing_if = "Option::is_none")]
415 pub no_check: Option<bool>,
416
417 /// Disable emitting file from a compilation.
418 ///
419 /// See more: https://www.typescriptlang.org/tsconfig#noEmit
420 #[serde(skip_serializing_if = "Option::is_none")]
421 pub no_emit: Option<bool>,
422
423 /// Enable error reporting for fallthrough cases in switch statements.
424 ///
425 /// See more: https://www.typescriptlang.org/tsconfig#noFallthroughCasesInSwitch
426 #[serde(skip_serializing_if = "Option::is_none")]
427 pub no_fallthrough_cases_in_switch: Option<bool>,
428
429 /// Disable generating custom helper functions like `__extends` in compiled output.
430 ///
431 /// See more: https://www.typescriptlang.org/tsconfig#noEmitHelpers
432 #[serde(skip_serializing_if = "Option::is_none")]
433 pub no_emit_helpers: Option<bool>,
434
435 /// Disable emitting files if any type checking errors are reported.
436 ///
437 /// See more: https://www.typescriptlang.org/tsconfig#noEmitOnError
438 #[serde(skip_serializing_if = "Option::is_none")]
439 pub no_emit_on_error: Option<bool>,
440
441 /// Disable truncating types in error messages.
442 ///
443 /// See more: https://www.typescriptlang.org/tsconfig#noErrorTruncation
444 #[serde(skip_serializing_if = "Option::is_none")]
445 pub no_error_truncation: Option<bool>,
446
447 /// Disable including any library files, including the default lib.d.ts.
448 ///
449 /// See more: https://www.typescriptlang.org/tsconfig#noLib
450 #[serde(skip_serializing_if = "Option::is_none")]
451 pub no_lib: Option<bool>,
452
453 /// Enable error reporting for expressions and declarations with an implied `any` type.
454 ///
455 /// See more: https://www.typescriptlang.org/tsconfig#noImplicitAny
456 #[serde(skip_serializing_if = "Option::is_none")]
457 pub no_implicit_any: Option<bool>,
458
459 /// Ensure overriding members in derived classes are marked with an override modifier.
460 ///
461 /// See more: https://www.typescriptlang.org/tsconfig#noImplicitOverride
462 #[serde(skip_serializing_if = "Option::is_none")]
463 pub no_implicit_override: Option<bool>,
464
465 /// Enable error reporting for codepaths that do not explicitly return in a function.
466 ///
467 /// See more: https://www.typescriptlang.org/tsconfig#noImplicitReturns
468 #[serde(skip_serializing_if = "Option::is_none")]
469 pub no_implicit_returns: Option<bool>,
470
471 /// Enable error reporting when `this` is given the type `any`.
472 ///
473 /// See more: https://www.typescriptlang.org/tsconfig#noImplicitThis
474 #[serde(skip_serializing_if = "Option::is_none")]
475 pub no_implicit_this: Option<bool>,
476
477 /// Disable adding 'use strict' directives in emitted JavaScript files.
478 ///
479 /// See more: https://www.typescriptlang.org/tsconfig#noImplicitUseStrict
480 #[serde(skip_serializing_if = "Option::is_none")]
481 pub no_implicit_use_strict: Option<bool>,
482
483 /// Enforces using indexed accessors for keys declared using an indexed type.
484 ///
485 /// See more: https://www.typescriptlang.org/tsconfig#noPropertyAccessFromIndexSignature
486 #[serde(skip_serializing_if = "Option::is_none")]
487 pub no_property_access_from_index_signature: Option<bool>,
488
489 /// Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project.
490 ///
491 /// See more: https://www.typescriptlang.org/tsconfig#noResolve
492 #[serde(skip_serializing_if = "Option::is_none")]
493 pub no_resolve: Option<bool>,
494
495 /// Disable strict checking of generic signatures in function types.
496 ///
497 /// See more: https://www.typescriptlang.org/tsconfig#noStrictGenericChecks
498 #[serde(skip_serializing_if = "Option::is_none")]
499 pub no_strict_generic_checks: Option<bool>,
500
501 /// Add `undefined` to a type when accessed using an index.
502 ///
503 /// See more: https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess
504 #[serde(skip_serializing_if = "Option::is_none")]
505 pub no_unchecked_indexed_access: Option<bool>,
506
507 /// Check side effect imports.
508 ///
509 /// See more: https://www.typescriptlang.org/tsconfig#noUncheckedSideEffectImports
510 #[serde(skip_serializing_if = "Option::is_none")]
511 pub no_unchecked_side_effect_imports: Option<bool>,
512
513 /// Enable error reporting when a local variable isn't read.
514 ///
515 /// See more: https://www.typescriptlang.org/tsconfig#noUnusedLocals
516 #[serde(skip_serializing_if = "Option::is_none")]
517 pub no_unused_locals: Option<bool>,
518
519 /// Raise an error when a function parameter isn't read.
520 ///
521 /// See more: https://www.typescriptlang.org/tsconfig#noUnusedParameters
522 #[serde(skip_serializing_if = "Option::is_none")]
523 pub no_unused_parameters: Option<bool>,
524
525 /// Save .tsbuildinfo files to allow for incremental compilation of projects.
526 ///
527 /// See more: https://www.typescriptlang.org/tsconfig#incremental
528 #[serde(skip_serializing_if = "Option::is_none")]
529 pub incremental: Option<bool>,
530
531 /// Include source code in the sourcemaps inside the emitted JavaScript.
532 ///
533 /// See more: https://www.typescriptlang.org/tsconfig#inlineSources
534 #[serde(skip_serializing_if = "Option::is_none")]
535 pub inline_sources: Option<bool>,
536
537 /// Include sourcemap files inside the emitted JavaScript.
538 ///
539 /// See more: https://www.typescriptlang.org/tsconfig#inlineSourceMap
540 #[serde(skip_serializing_if = "Option::is_none")]
541 pub inline_source_map: Option<bool>,
542
543 /// Allow importing helper functions from tslib once per project, instead of including them per-file.
544 ///
545 /// See more: https://www.typescriptlang.org/tsconfig#importHelpers
546 #[serde(skip_serializing_if = "Option::is_none")]
547 pub import_helpers: Option<bool>,
548
549 /// Require sufficient annotation on exports so other tools can trivially generate declaration files.
550 ///
551 /// See more: https://www.typescriptlang.org/tsconfig#isolatedDeclarations
552 #[serde(skip_serializing_if = "Option::is_none")]
553 pub isolated_declarations: Option<bool>,
554
555 /// Ensure that each file can be safely transpiled without relying on other imports.
556 ///
557 /// See more: https://www.typescriptlang.org/tsconfig#isolatedModules
558 #[serde(skip_serializing_if = "Option::is_none")]
559 pub isolated_modules: Option<bool>,
560
561 /// Specify an output folder for all emitted files.
562 ///
563 /// See more: https://www.typescriptlang.org/tsconfig#outDir
564 #[serde(skip_serializing_if = "Option::is_none")]
565 pub out_dir: Option<String>,
566
567 /// 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.
568 ///
569 /// See more: https://www.typescriptlang.org/tsconfig#outFile
570 #[serde(skip_serializing_if = "Option::is_none")]
571 pub out_file: Option<String>,
572
573 /// Specify a set of entries that re-map imports to additional lookup locations.
574 ///
575 /// See more: https://www.typescriptlang.org/tsconfig/#paths
576 #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]
577 pub paths: BTreeMap<String, BTreeSet<String>>,
578
579 /// Specify a list of language service plugins to include.
580 ///
581 /// See more: https://www.typescriptlang.org/tsconfig#plugins
582 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
583 pub plugins: BTreeSet<TsPlugin>,
584
585 /// Disable erasing `const enum` declarations in generated code.
586 ///
587 /// See more: https://www.typescriptlang.org/tsconfig#preserveConstEnums
588 #[serde(skip_serializing_if = "Option::is_none")]
589 pub preserve_const_enums: Option<bool>,
590
591 /// Disable resolving symlinks to their realpath. This correlates to the same flag in node.
592 ///
593 /// See more: https://www.typescriptlang.org/tsconfig#preserveSymlinks
594 #[serde(skip_serializing_if = "Option::is_none")]
595 pub preserve_symlinks: Option<bool>,
596
597 /// Disable wiping the console in watch mode.
598 ///
599 /// See more: https://www.typescriptlang.org/tsconfig#preserveWatchOutput
600 #[serde(skip_serializing_if = "Option::is_none")]
601 pub preserve_watch_output: Option<bool>,
602
603 /// Enable color and formatting in output to make compiler errors easier to read.
604 ///
605 /// See more: https://www.typescriptlang.org/tsconfig#pretty
606 #[serde(skip_serializing_if = "Option::is_none")]
607 pub pretty: Option<bool>,
608
609 /// Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit.
610 ///
611 /// See more: https://www.typescriptlang.org/tsconfig#reactNamespace
612 #[serde(skip_serializing_if = "Option::is_none")]
613 pub react_namespace: Option<String>,
614
615 /// Disable emitting comments.
616 ///
617 /// See more: https://www.typescriptlang.org/tsconfig#removeComments
618 #[serde(skip_serializing_if = "Option::is_none")]
619 pub remove_comments: Option<bool>,
620
621 /// Enable importing .json files.
622 ///
623 /// See more: https://www.typescriptlang.org/tsconfig#resolveJsonModule
624 #[serde(skip_serializing_if = "Option::is_none")]
625 pub resolve_json_module: Option<bool>,
626
627 /// Specify the root folder within your source files.
628 ///
629 /// See more: https://www.typescriptlang.org/tsconfig#rootDir
630 #[serde(skip_serializing_if = "Option::is_none")]
631 pub root_dir: Option<String>,
632
633 /// Specify the root folder within your source files.
634 ///
635 /// See more: https://www.typescriptlang.org/tsconfig#rootDir
636 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
637 pub root_dirs: BTreeSet<String>,
638
639 /// Skip type checking .d.ts files that are included with TypeScript.
640 ///
641 /// See more: https://www.typescriptlang.org/tsconfig#skipDefaultLibCheck
642 #[serde(skip_serializing_if = "Option::is_none")]
643 pub skip_default_lib_check: Option<bool>,
644
645 /// Skip type checking all .d.ts files.
646 ///
647 /// See more: https://www.typescriptlang.org/tsconfig#skipLibCheck
648 #[serde(skip_serializing_if = "Option::is_none")]
649 pub skip_lib_check: Option<bool>,
650
651 /// Create source map files for emitted JavaScript files.
652 ///
653 /// See more: https://www.typescriptlang.org/tsconfig#sourceMap
654 #[serde(skip_serializing_if = "Option::is_none")]
655 pub source_map: Option<bool>,
656
657 /// Specify the root path for debuggers to find the reference source code.
658 ///
659 /// See more: https://www.typescriptlang.org/tsconfig#sourceRoot
660 #[serde(skip_serializing_if = "Option::is_none")]
661 pub source_root: Option<String>,
662
663 /// Enable all strict type checking options.
664 ///
665 /// See more: https://www.typescriptlang.org/tsconfig#strict
666 #[serde(skip_serializing_if = "Option::is_none")]
667 pub strict: Option<bool>,
668
669 /// Check that the arguments for `bind`, `call`, and `apply` methods match the original function.
670 ///
671 /// See more: https://www.typescriptlang.org/tsconfig#strictBindCallApply
672 #[serde(skip_serializing_if = "Option::is_none")]
673 pub strict_bind_call_apply: Option<bool>,
674
675 /// Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'.
676 ///
677 /// See more: https://www.typescriptlang.org/tsconfig#strictBuiltinIteratorReturn
678 #[serde(skip_serializing_if = "Option::is_none")]
679 pub strict_builtin_iterator_return: Option<bool>,
680
681 /// When assigning functions, check to ensure parameters and the return values are subtype-compatible.
682 ///
683 /// See more: https://www.typescriptlang.org/tsconfig#strictFunctionTypes
684 #[serde(skip_serializing_if = "Option::is_none")]
685 pub strict_function_types: Option<bool>,
686
687 /// When type checking, take into account `null` and `undefined`.
688 ///
689 /// See more: https://www.typescriptlang.org/tsconfig#strictNullChecks
690 #[serde(skip_serializing_if = "Option::is_none")]
691 pub strict_null_checks: Option<bool>,
692
693 /// Check for class properties that are declared but not set in the constructor.\n\n
694 ///
695 /// See more: https://www.typescriptlang.org/tsconfig#strictPropertyInitialization
696 #[serde(skip_serializing_if = "Option::is_none")]
697 pub strict_property_initialization: Option<bool>,
698
699 /// Disable emitting declarations that have `@internal` in their JSDoc comments.
700 ///
701 /// See more: https://www.typescriptlang.org/tsconfig#stripInternal
702 #[serde(skip_serializing_if = "Option::is_none")]
703 pub strip_internal: Option<bool>,
704
705 /// Disable reporting of excess property errors during the creation of object literals.
706 ///
707 /// See more: https://www.typescriptlang.org/tsconfig#suppressExcessPropertyErrors
708 #[serde(skip_serializing_if = "Option::is_none")]
709 pub suppress_excess_property_errors: Option<bool>,
710
711 /// Suppress `noImplicitAny` errors when indexing objects that lack index signatures.
712 ///
713 /// See more: https://www.typescriptlang.org/tsconfig#suppressImplicitAnyIndexErrors
714 #[serde(skip_serializing_if = "Option::is_none")]
715 pub suppress_implicit_any_index_errors: Option<bool>,
716
717 /// Set the JavaScript language version for emitted JavaScript and include compatible library declarations.
718 ///
719 /// See more: https://www.typescriptlang.org/tsconfig#target
720 #[serde(skip_serializing_if = "Option::is_none")]
721 pub target: Option<Target>,
722
723 /// Log paths used during the `moduleResolution` process.
724 ///
725 /// See more: https://www.typescriptlang.org/tsconfig#traceResolution
726 #[serde(skip_serializing_if = "Option::is_none")]
727 pub trace_resolution: Option<bool>,
728
729 /// Specify the folder for .tsbuildinfo incremental compilation files.
730 ///
731 /// See more: https://www.typescriptlang.org/tsconfig#tsBuildInfoFile
732 #[serde(skip_serializing_if = "Option::is_none")]
733 pub ts_build_info_file: Option<String>,
734
735 /// Specify type package names to be included without being referenced in a source file.
736 ///
737 /// See more: https://www.typescriptlang.org/tsconfig#types
738 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
739 pub types: BTreeSet<String>,
740
741 /// Specify multiple folders that act like `./node_modules/@types`.
742 ///
743 /// See more: https://www.typescriptlang.org/tsconfig#typeRoots
744 #[serde(default, skip_serializing_if = "BTreeSet::is_empty")]
745 pub type_roots: BTreeSet<String>,
746
747 /// Use the package.json 'exports' field when resolving package imports.
748 ///
749 /// See more: https://www.typescriptlang.org/tsconfig#resolvePackageJsonExports
750 #[serde(skip_serializing_if = "Option::is_none")]
751 pub resolve_package_json_exports: Option<bool>,
752
753 /// Use the package.json 'imports' field when resolving imports.
754 ///
755 /// See more: https://www.typescriptlang.org/tsconfig#resolvePackageJsonImports
756 #[serde(skip_serializing_if = "Option::is_none")]
757 pub resolve_package_json_imports: Option<bool>,
758
759 /// Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files.
760 ///
761 /// See more: https://www.typescriptlang.org/tsconfig#rewriteRelativeImportExtensions
762 #[serde(skip_serializing_if = "Option::is_none")]
763 pub rewrite_relative_imports_extensions: Option<bool>,
764
765 /// Emit ECMAScript-standard-compliant class fields.
766 ///
767 /// See more: https://www.typescriptlang.org/tsconfig#useDefineForClassFields
768 #[serde(skip_serializing_if = "Option::is_none")]
769 pub use_define_for_class_fields: Option<bool>,
770
771 /// Default catch clause variables as `unknown` instead of `any`.
772 ///
773 /// See more: https://www.typescriptlang.org/tsconfig#useUnknownInCatchVariables
774 #[serde(skip_serializing_if = "Option::is_none")]
775 pub use_unknown_in_catch_variables: Option<bool>,
776
777 /// Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting.
778 ///
779 /// See more: https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax
780 #[serde(skip_serializing_if = "Option::is_none")]
781 pub verbatim_module_syntax: Option<bool>,
782}