tsc-ts 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -1
- package/dist/api/compiler/ast-utilities.d.ts +82 -0
- package/dist/api/compiler/ast-utilities.js +462 -0
- package/dist/api/compiler/ast.d.ts +2350 -0
- package/dist/api/compiler/ast.js +11206 -0
- package/dist/api/compiler/astnav.d.ts +37 -0
- package/dist/api/compiler/astnav.js +767 -0
- package/dist/api/compiler/binder-utilities.d.ts +182 -0
- package/dist/api/compiler/binder-utilities.js +1240 -0
- package/dist/api/compiler/binder.d.ts +33 -0
- package/dist/api/compiler/binder.js +2358 -0
- package/dist/api/compiler/character-codes.d.ts +161 -0
- package/dist/api/compiler/character-codes.js +160 -0
- package/dist/api/compiler/checker-calls.d.ts +46 -0
- package/dist/api/compiler/checker-calls.js +1640 -0
- package/dist/api/compiler/checker-classes.d.ts +30 -0
- package/dist/api/compiler/checker-classes.js +582 -0
- package/dist/api/compiler/checker-contextual.d.ts +77 -0
- package/dist/api/compiler/checker-contextual.js +1136 -0
- package/dist/api/compiler/checker-declaration-order.d.ts +12 -0
- package/dist/api/compiler/checker-declaration-order.js +356 -0
- package/dist/api/compiler/checker-declarations.d.ts +33 -0
- package/dist/api/compiler/checker-declarations.js +888 -0
- package/dist/api/compiler/checker-declared-types.d.ts +48 -0
- package/dist/api/compiler/checker-declared-types.js +787 -0
- package/dist/api/compiler/checker-decorators.d.ts +26 -0
- package/dist/api/compiler/checker-decorators.js +562 -0
- package/dist/api/compiler/checker-deprecation.d.ts +33 -0
- package/dist/api/compiler/checker-deprecation.js +315 -0
- package/dist/api/compiler/checker-destructuring.d.ts +34 -0
- package/dist/api/compiler/checker-destructuring.js +584 -0
- package/dist/api/compiler/checker-elaboration.d.ts +15 -0
- package/dist/api/compiler/checker-elaboration.js +290 -0
- package/dist/api/compiler/checker-emit-helpers.d.ts +58 -0
- package/dist/api/compiler/checker-emit-helpers.js +154 -0
- package/dist/api/compiler/checker-emit-resolver.d.ts +75 -0
- package/dist/api/compiler/checker-emit-resolver.js +579 -0
- package/dist/api/compiler/checker-evaluator.d.ts +27 -0
- package/dist/api/compiler/checker-evaluator.js +188 -0
- package/dist/api/compiler/checker-expressions.d.ts +67 -0
- package/dist/api/compiler/checker-expressions.js +1351 -0
- package/dist/api/compiler/checker-features.d.ts +6 -0
- package/dist/api/compiler/checker-features.js +354 -0
- package/dist/api/compiler/checker-flow.d.ts +86 -0
- package/dist/api/compiler/checker-flow.js +169 -0
- package/dist/api/compiler/checker-functions.d.ts +43 -0
- package/dist/api/compiler/checker-functions.js +1002 -0
- package/dist/api/compiler/checker-generated-code.d.ts +25 -0
- package/dist/api/compiler/checker-generated-code.js +168 -0
- package/dist/api/compiler/checker-globals.d.ts +14 -0
- package/dist/api/compiler/checker-globals.js +37 -0
- package/dist/api/compiler/checker-grammar.d.ts +35 -0
- package/dist/api/compiler/checker-grammar.js +2573 -0
- package/dist/api/compiler/checker-heritage.d.ts +28 -0
- package/dist/api/compiler/checker-heritage.js +900 -0
- package/dist/api/compiler/checker-inference.d.ts +179 -0
- package/dist/api/compiler/checker-inference.js +2105 -0
- package/dist/api/compiler/checker-iteration.d.ts +115 -0
- package/dist/api/compiler/checker-iteration.js +857 -0
- package/dist/api/compiler/checker-javascript.d.ts +42 -0
- package/dist/api/compiler/checker-javascript.js +441 -0
- package/dist/api/compiler/checker-jsdoc.d.ts +30 -0
- package/dist/api/compiler/checker-jsdoc.js +320 -0
- package/dist/api/compiler/checker-jsx.d.ts +94 -0
- package/dist/api/compiler/checker-jsx.js +1433 -0
- package/dist/api/compiler/checker-literals.d.ts +6 -0
- package/dist/api/compiler/checker-literals.js +43 -0
- package/dist/api/compiler/checker-members.d.ts +198 -0
- package/dist/api/compiler/checker-members.js +2126 -0
- package/dist/api/compiler/checker-modules.d.ts +85 -0
- package/dist/api/compiler/checker-modules.js +2141 -0
- package/dist/api/compiler/checker-narrowing.d.ts +120 -0
- package/dist/api/compiler/checker-narrowing.js +2797 -0
- package/dist/api/compiler/checker-object-literals.d.ts +14 -0
- package/dist/api/compiler/checker-object-literals.js +479 -0
- package/dist/api/compiler/checker-operators.d.ts +33 -0
- package/dist/api/compiler/checker-operators.js +1040 -0
- package/dist/api/compiler/checker-overloads.d.ts +7 -0
- package/dist/api/compiler/checker-overloads.js +270 -0
- package/dist/api/compiler/checker-property-access.d.ts +34 -0
- package/dist/api/compiler/checker-property-access.js +672 -0
- package/dist/api/compiler/checker-services.d.ts +49 -0
- package/dist/api/compiler/checker-services.js +995 -0
- package/dist/api/compiler/checker-signatures.d.ts +55 -0
- package/dist/api/compiler/checker-signatures.js +788 -0
- package/dist/api/compiler/checker-source-file.d.ts +27 -0
- package/dist/api/compiler/checker-source-file.js +619 -0
- package/dist/api/compiler/checker-statements.d.ts +18 -0
- package/dist/api/compiler/checker-statements.js +226 -0
- package/dist/api/compiler/checker-super.d.ts +13 -0
- package/dist/api/compiler/checker-super.js +241 -0
- package/dist/api/compiler/checker-symbol-types.d.ts +67 -0
- package/dist/api/compiler/checker-symbol-types.js +1885 -0
- package/dist/api/compiler/checker-symbols.d.ts +181 -0
- package/dist/api/compiler/checker-symbols.js +1782 -0
- package/dist/api/compiler/checker-type-factory.d.ts +142 -0
- package/dist/api/compiler/checker-type-factory.js +2501 -0
- package/dist/api/compiler/checker-type-nodes.d.ts +26 -0
- package/dist/api/compiler/checker-type-nodes.js +828 -0
- package/dist/api/compiler/checker-type-operators.d.ts +109 -0
- package/dist/api/compiler/checker-type-operators.js +1842 -0
- package/dist/api/compiler/checker-types.d.ts +1027 -0
- package/dist/api/compiler/checker-types.js +1697 -0
- package/dist/api/compiler/checker-unused.d.ts +19 -0
- package/dist/api/compiler/checker-unused.js +524 -0
- package/dist/api/compiler/checker-utilities.d.ts +33 -0
- package/dist/api/compiler/checker-utilities.js +141 -0
- package/dist/api/compiler/checker.d.ts +491 -0
- package/dist/api/compiler/checker.js +912 -0
- package/dist/api/compiler/command-line.d.ts +32 -0
- package/dist/api/compiler/command-line.js +383 -0
- package/dist/api/compiler/compile-program.d.ts +118 -0
- package/dist/api/compiler/compile-program.js +384 -0
- package/dist/api/compiler/diagnostic-locales.d.ts +22 -0
- package/dist/api/compiler/diagnostic-locales.js +64 -0
- package/dist/api/compiler/diagnostic-messages.d.ts +2166 -0
- package/dist/api/compiler/diagnostic-messages.js +184 -0
- package/dist/api/compiler/diagnostics.d.ts +167 -0
- package/dist/api/compiler/diagnostics.js +820 -0
- package/dist/api/compiler/emitter.d.ts +71 -0
- package/dist/api/compiler/emitter.js +327 -0
- package/dist/api/compiler/file-include.d.ts +117 -0
- package/dist/api/compiler/file-include.js +536 -0
- package/dist/api/compiler/file-loader.d.ts +261 -0
- package/dist/api/compiler/file-loader.js +1257 -0
- package/dist/api/compiler/file-system.d.ts +51 -0
- package/dist/api/compiler/file-system.js +132 -0
- package/dist/api/compiler/flow.d.ts +60 -0
- package/dist/api/compiler/flow.js +45 -0
- package/dist/api/compiler/instantiation.d.ts +74 -0
- package/dist/api/compiler/instantiation.js +799 -0
- package/dist/api/compiler/jsdoc.d.ts +75 -0
- package/dist/api/compiler/jsdoc.js +1229 -0
- package/dist/api/compiler/link-tables.d.ts +36 -0
- package/dist/api/compiler/link-tables.js +83 -0
- package/dist/api/compiler/locale-data.d.ts +24 -0
- package/dist/api/compiler/locale-data.js +183 -0
- package/dist/api/compiler/locale.d.ts +4 -0
- package/dist/api/compiler/locale.js +317 -0
- package/dist/api/compiler/locales/cs-CZ.d.ts +2 -0
- package/dist/api/compiler/locales/cs-CZ.js +3 -0
- package/dist/api/compiler/locales/de-DE.d.ts +2 -0
- package/dist/api/compiler/locales/de-DE.js +3 -0
- package/dist/api/compiler/locales/es-ES.d.ts +2 -0
- package/dist/api/compiler/locales/es-ES.js +3 -0
- package/dist/api/compiler/locales/fr-FR.d.ts +2 -0
- package/dist/api/compiler/locales/fr-FR.js +3 -0
- package/dist/api/compiler/locales/it-IT.d.ts +2 -0
- package/dist/api/compiler/locales/it-IT.js +3 -0
- package/dist/api/compiler/locales/ja-JP.d.ts +2 -0
- package/dist/api/compiler/locales/ja-JP.js +3 -0
- package/dist/api/compiler/locales/ko-KR.d.ts +2 -0
- package/dist/api/compiler/locales/ko-KR.js +3 -0
- package/dist/api/compiler/locales/pl-PL.d.ts +2 -0
- package/dist/api/compiler/locales/pl-PL.js +3 -0
- package/dist/api/compiler/locales/pt-BR.d.ts +2 -0
- package/dist/api/compiler/locales/pt-BR.js +3 -0
- package/dist/api/compiler/locales/ru-RU.d.ts +2 -0
- package/dist/api/compiler/locales/ru-RU.js +3 -0
- package/dist/api/compiler/locales/tr-TR.d.ts +2 -0
- package/dist/api/compiler/locales/tr-TR.js +3 -0
- package/dist/api/compiler/locales/zh-CN.d.ts +2 -0
- package/dist/api/compiler/locales/zh-CN.js +3 -0
- package/dist/api/compiler/locales/zh-TW.d.ts +2 -0
- package/dist/api/compiler/locales/zh-TW.js +3 -0
- package/dist/api/compiler/module-resolution-types.d.ts +83 -0
- package/dist/api/compiler/module-resolution-types.js +176 -0
- package/dist/api/compiler/module-resolution.d.ts +71 -0
- package/dist/api/compiler/module-resolution.js +1598 -0
- package/dist/api/compiler/module-specifiers.d.ts +64 -0
- package/dist/api/compiler/module-specifiers.js +1101 -0
- package/dist/api/compiler/name-resolver.d.ts +43 -0
- package/dist/api/compiler/name-resolver.js +509 -0
- package/dist/api/compiler/node-builder-names.d.ts +32 -0
- package/dist/api/compiler/node-builder-names.js +854 -0
- package/dist/api/compiler/node-builder-pseudo.d.ts +36 -0
- package/dist/api/compiler/node-builder-pseudo.js +744 -0
- package/dist/api/compiler/node-builder-reuse.d.ts +4 -0
- package/dist/api/compiler/node-builder-reuse.js +647 -0
- package/dist/api/compiler/node-builder.d.ts +270 -0
- package/dist/api/compiler/node-builder.js +2645 -0
- package/dist/api/compiler/option-declarations.d.ts +90 -0
- package/dist/api/compiler/option-declarations.js +1460 -0
- package/dist/api/compiler/options.d.ts +289 -0
- package/dist/api/compiler/options.js +1197 -0
- package/dist/api/compiler/output-paths.d.ts +42 -0
- package/dist/api/compiler/output-paths.js +195 -0
- package/dist/api/compiler/package-json.d.ts +175 -0
- package/dist/api/compiler/package-json.js +1015 -0
- package/dist/api/compiler/parallel-parse.d.ts +219 -0
- package/dist/api/compiler/parallel-parse.js +537 -0
- package/dist/api/compiler/parser.d.ts +587 -0
- package/dist/api/compiler/parser.js +6407 -0
- package/dist/api/compiler/path.d.ts +91 -0
- package/dist/api/compiler/path.js +705 -0
- package/dist/api/compiler/printer/async-helpers.d.ts +22 -0
- package/dist/api/compiler/printer/async-helpers.js +91 -0
- package/dist/api/compiler/printer/auto-generate.d.ts +13 -0
- package/dist/api/compiler/printer/auto-generate.js +20 -0
- package/dist/api/compiler/printer/decorator-helpers.d.ts +24 -0
- package/dist/api/compiler/printer/decorator-helpers.js +118 -0
- package/dist/api/compiler/printer/emit-context.d.ts +154 -0
- package/dist/api/compiler/printer/emit-context.js +576 -0
- package/dist/api/compiler/printer/emit-flags.d.ts +60 -0
- package/dist/api/compiler/printer/emit-flags.js +2 -0
- package/dist/api/compiler/printer/factory-base.d.ts +171 -0
- package/dist/api/compiler/printer/factory-base.js +1505 -0
- package/dist/api/compiler/printer/factory.d.ts +147 -0
- package/dist/api/compiler/printer/factory.js +542 -0
- package/dist/api/compiler/printer/helpers.d.ts +27 -0
- package/dist/api/compiler/printer/helpers.js +164 -0
- package/dist/api/compiler/printer/name-generator.d.ts +41 -0
- package/dist/api/compiler/printer/name-generator.js +283 -0
- package/dist/api/compiler/printer/printer.d.ts +411 -0
- package/dist/api/compiler/printer/printer.js +4517 -0
- package/dist/api/compiler/printer/text-writer.d.ts +46 -0
- package/dist/api/compiler/printer/text-writer.js +172 -0
- package/dist/api/compiler/printer/utilities.d.ts +82 -0
- package/dist/api/compiler/printer/utilities.js +817 -0
- package/dist/api/compiler/program-checker.d.ts +156 -0
- package/dist/api/compiler/program-checker.js +526 -0
- package/dist/api/compiler/program-utilities.d.ts +52 -0
- package/dist/api/compiler/program-utilities.js +365 -0
- package/dist/api/compiler/program.d.ts +180 -0
- package/dist/api/compiler/program.js +1011 -0
- package/dist/api/compiler/pseudo-bigint.d.ts +5 -0
- package/dist/api/compiler/pseudo-bigint.js +61 -0
- package/dist/api/compiler/regexp-checker.d.ts +38 -0
- package/dist/api/compiler/regexp-checker.js +942 -0
- package/dist/api/compiler/relations.d.ts +263 -0
- package/dist/api/compiler/relations.js +4002 -0
- package/dist/api/compiler/reparser.d.ts +48 -0
- package/dist/api/compiler/reparser.js +1323 -0
- package/dist/api/compiler/scanner.d.ts +256 -0
- package/dist/api/compiler/scanner.js +2853 -0
- package/dist/api/compiler/side-state.d.ts +16 -0
- package/dist/api/compiler/side-state.js +89 -0
- package/dist/api/compiler/sourcemap.d.ts +55 -0
- package/dist/api/compiler/sourcemap.js +340 -0
- package/dist/api/compiler/spelling.d.ts +14 -0
- package/dist/api/compiler/spelling.js +128 -0
- package/dist/api/compiler/symbol-accessibility.d.ts +57 -0
- package/dist/api/compiler/symbol-accessibility.js +894 -0
- package/dist/api/compiler/symbol.d.ts +240 -0
- package/dist/api/compiler/symbol.js +228 -0
- package/dist/api/compiler/symlinks.d.ts +32 -0
- package/dist/api/compiler/symlinks.js +114 -0
- package/dist/api/compiler/syntax-kind.d.ts +389 -0
- package/dist/api/compiler/syntax-kind.js +2 -0
- package/dist/api/compiler/timeline.d.ts +9 -0
- package/dist/api/compiler/timeline.js +54 -0
- package/dist/api/compiler/transformers/alias-references.d.ts +39 -0
- package/dist/api/compiler/transformers/alias-references.js +676 -0
- package/dist/api/compiler/transformers/async-utilities.d.ts +51 -0
- package/dist/api/compiler/transformers/async-utilities.js +260 -0
- package/dist/api/compiler/transformers/async.d.ts +53 -0
- package/dist/api/compiler/transformers/async.js +645 -0
- package/dist/api/compiler/transformers/class-fields.d.ts +206 -0
- package/dist/api/compiler/transformers/class-fields.js +2418 -0
- package/dist/api/compiler/transformers/class-utilities.d.ts +46 -0
- package/dist/api/compiler/transformers/class-utilities.js +261 -0
- package/dist/api/compiler/transformers/commonjs-module.d.ts +103 -0
- package/dist/api/compiler/transformers/commonjs-module.js +1180 -0
- package/dist/api/compiler/transformers/const-enum-inliner.d.ts +11 -0
- package/dist/api/compiler/transformers/const-enum-inliner.js +36 -0
- package/dist/api/compiler/transformers/declarations-diagnostics.d.ts +52 -0
- package/dist/api/compiler/transformers/declarations-diagnostics.js +538 -0
- package/dist/api/compiler/transformers/declarations-pseudo.d.ts +160 -0
- package/dist/api/compiler/transformers/declarations-pseudo.js +797 -0
- package/dist/api/compiler/transformers/declarations-resolver.d.ts +152 -0
- package/dist/api/compiler/transformers/declarations-resolver.js +35 -0
- package/dist/api/compiler/transformers/declarations-syntactic.d.ts +119 -0
- package/dist/api/compiler/transformers/declarations-syntactic.js +1582 -0
- package/dist/api/compiler/transformers/declarations-tracker.d.ts +46 -0
- package/dist/api/compiler/transformers/declarations-tracker.js +197 -0
- package/dist/api/compiler/transformers/declarations.d.ts +175 -0
- package/dist/api/compiler/transformers/declarations.js +2380 -0
- package/dist/api/compiler/transformers/decorator-metadata.d.ts +54 -0
- package/dist/api/compiler/transformers/decorator-metadata.js +554 -0
- package/dist/api/compiler/transformers/decorator-utilities.d.ts +38 -0
- package/dist/api/compiler/transformers/decorator-utilities.js +238 -0
- package/dist/api/compiler/transformers/destructuring.d.ts +25 -0
- package/dist/api/compiler/transformers/destructuring.js +626 -0
- package/dist/api/compiler/transformers/downlevel.d.ts +6 -0
- package/dist/api/compiler/transformers/downlevel.js +45 -0
- package/dist/api/compiler/transformers/emit-resolver.d.ts +61 -0
- package/dist/api/compiler/transformers/emit-resolver.js +197 -0
- package/dist/api/compiler/transformers/es-decorators.d.ts +118 -0
- package/dist/api/compiler/transformers/es-decorators.js +1901 -0
- package/dist/api/compiler/transformers/exponentiation.d.ts +11 -0
- package/dist/api/compiler/transformers/exponentiation.js +76 -0
- package/dist/api/compiler/transformers/external-module-info.d.ts +35 -0
- package/dist/api/compiler/transformers/external-module-info.js +351 -0
- package/dist/api/compiler/transformers/for-await.d.ts +43 -0
- package/dist/api/compiler/transformers/for-await.js +469 -0
- package/dist/api/compiler/transformers/import-elision.d.ts +16 -0
- package/dist/api/compiler/transformers/import-elision.js +124 -0
- package/dist/api/compiler/transformers/jsx-entities.d.ts +1 -0
- package/dist/api/compiler/transformers/jsx-entities.js +256 -0
- package/dist/api/compiler/transformers/jsx.d.ts +71 -0
- package/dist/api/compiler/transformers/jsx.js +700 -0
- package/dist/api/compiler/transformers/legacy-decorators.d.ts +56 -0
- package/dist/api/compiler/transformers/legacy-decorators.js +564 -0
- package/dist/api/compiler/transformers/logical-assignment.d.ts +14 -0
- package/dist/api/compiler/transformers/logical-assignment.js +62 -0
- package/dist/api/compiler/transformers/module-utilities.d.ts +9 -0
- package/dist/api/compiler/transformers/module-utilities.js +36 -0
- package/dist/api/compiler/transformers/module.d.ts +49 -0
- package/dist/api/compiler/transformers/module.js +296 -0
- package/dist/api/compiler/transformers/named-evaluation.d.ts +26 -0
- package/dist/api/compiler/transformers/named-evaluation.js +266 -0
- package/dist/api/compiler/transformers/nullish-coalescing.d.ts +9 -0
- package/dist/api/compiler/transformers/nullish-coalescing.js +26 -0
- package/dist/api/compiler/transformers/object-rest-spread.d.ts +34 -0
- package/dist/api/compiler/transformers/object-rest-spread.js +411 -0
- package/dist/api/compiler/transformers/optional-catch.d.ts +9 -0
- package/dist/api/compiler/transformers/optional-catch.js +20 -0
- package/dist/api/compiler/transformers/optional-chain.d.ts +14 -0
- package/dist/api/compiler/transformers/optional-chain.js +188 -0
- package/dist/api/compiler/transformers/reference-resolver.d.ts +128 -0
- package/dist/api/compiler/transformers/reference-resolver.js +1155 -0
- package/dist/api/compiler/transformers/runtime-syntax.d.ts +71 -0
- package/dist/api/compiler/transformers/runtime-syntax.js +753 -0
- package/dist/api/compiler/transformers/subtree-facts.d.ts +9 -0
- package/dist/api/compiler/transformers/subtree-facts.js +203 -0
- package/dist/api/compiler/transformers/syntax-facts.d.ts +51 -0
- package/dist/api/compiler/transformers/syntax-facts.js +254 -0
- package/dist/api/compiler/transformers/tagged-template.d.ts +17 -0
- package/dist/api/compiler/transformers/tagged-template.js +148 -0
- package/dist/api/compiler/transformers/transformer.d.ts +17 -0
- package/dist/api/compiler/transformers/transformer.js +54 -0
- package/dist/api/compiler/transformers/type-eraser.d.ts +21 -0
- package/dist/api/compiler/transformers/type-eraser.js +346 -0
- package/dist/api/compiler/transformers/type-serialization.d.ts +20 -0
- package/dist/api/compiler/transformers/type-serialization.js +347 -0
- package/dist/api/compiler/transformers/using.d.ts +56 -0
- package/dist/api/compiler/transformers/using.js +453 -0
- package/dist/api/compiler/transformers/utilities.d.ts +50 -0
- package/dist/api/compiler/transformers/utilities.js +347 -0
- package/dist/api/compiler/transformers/visitor-base.d.ts +6 -0
- package/dist/api/compiler/transformers/visitor-base.js +817 -0
- package/dist/api/compiler/transformers/visitor-hooks.d.ts +29 -0
- package/dist/api/compiler/transformers/visitor-hooks.js +189 -0
- package/dist/api/compiler/tsconfig.d.ts +177 -0
- package/dist/api/compiler/tsconfig.js +1311 -0
- package/dist/api/compiler/type-printer.d.ts +15 -0
- package/dist/api/compiler/type-printer.js +74 -0
- package/dist/api/compiler/types.d.ts +87 -0
- package/dist/api/compiler/types.js +23 -0
- package/dist/api/compiler/unicode-identifiers.d.ts +2 -0
- package/dist/api/compiler/unicode-identifiers.js +209 -0
- package/dist/api/compiler/unicode-properties.d.ts +8 -0
- package/dist/api/compiler/unicode-properties.js +531 -0
- package/dist/api/compiler/vfs-match.d.ts +24 -0
- package/dist/api/compiler/vfs-match.js +587 -0
- package/dist/api/library/ast.d.ts +3 -2
- package/dist/api/library/ast.generated.d.ts +127 -139
- package/dist/api/library/checker.d.ts +51 -0
- package/dist/api/library/checker.js +318 -0
- package/dist/api/library/diagnostics.d.ts +13 -0
- package/dist/api/library/diagnostics.js +50 -0
- package/dist/api/library/disk.d.ts +13 -0
- package/dist/api/library/disk.js +66 -0
- package/dist/api/library/errors.d.ts +13 -0
- package/dist/api/library/errors.js +24 -0
- package/dist/api/library/host.d.ts +24 -0
- package/dist/api/library/host.js +52 -0
- package/dist/api/library/index.d.ts +5 -1
- package/dist/api/library/index.js +4 -0
- package/dist/api/library/nodes.d.ts +51 -0
- package/dist/api/library/nodes.js +196 -0
- package/dist/api/library/options.d.ts +144 -0
- package/dist/api/library/options.js +308 -0
- package/dist/api/library/parse.d.ts +19 -0
- package/dist/api/library/parse.js +41 -0
- package/dist/api/library/program.d.ts +21 -0
- package/dist/api/library/program.js +234 -0
- package/dist/api/library/types.d.ts +14 -1
- package/package.json +12 -8
- package/src/compiler/ast-utilities.ts +548 -0
- package/src/compiler/ast.ts +12862 -0
- package/src/compiler/astnav.ts +799 -0
- package/src/compiler/binder-utilities.ts +1392 -0
- package/src/compiler/binder.ts +2703 -0
- package/src/compiler/build-info.ts +1197 -0
- package/src/compiler/character-codes.ts +323 -0
- package/src/compiler/checker-calls.ts +2155 -0
- package/src/compiler/checker-classes.ts +706 -0
- package/src/compiler/checker-contextual.ts +1457 -0
- package/src/compiler/checker-declaration-order.ts +438 -0
- package/src/compiler/checker-declarations.ts +1194 -0
- package/src/compiler/checker-declared-types.ts +919 -0
- package/src/compiler/checker-decorators.ts +694 -0
- package/src/compiler/checker-deprecation.ts +359 -0
- package/src/compiler/checker-destructuring.ts +805 -0
- package/src/compiler/checker-elaboration.ts +477 -0
- package/src/compiler/checker-emit-helpers.ts +224 -0
- package/src/compiler/checker-emit-resolver.ts +769 -0
- package/src/compiler/checker-evaluator.ts +243 -0
- package/src/compiler/checker-expressions.ts +1831 -0
- package/src/compiler/checker-features.ts +361 -0
- package/src/compiler/checker-flow.ts +394 -0
- package/src/compiler/checker-functions.ts +1296 -0
- package/src/compiler/checker-generated-code.ts +227 -0
- package/src/compiler/checker-globals.ts +52 -0
- package/src/compiler/checker-grammar.ts +3584 -0
- package/src/compiler/checker-heritage.ts +1233 -0
- package/src/compiler/checker-inference.ts +2576 -0
- package/src/compiler/checker-iteration.ts +1206 -0
- package/src/compiler/checker-javascript.ts +502 -0
- package/src/compiler/checker-jsdoc.ts +360 -0
- package/src/compiler/checker-jsx.ts +1924 -0
- package/src/compiler/checker-literals.ts +61 -0
- package/src/compiler/checker-members.ts +2436 -0
- package/src/compiler/checker-modules.ts +2886 -0
- package/src/compiler/checker-narrowing.ts +3230 -0
- package/src/compiler/checker-object-literals.ts +575 -0
- package/src/compiler/checker-operators.ts +1422 -0
- package/src/compiler/checker-overloads.ts +328 -0
- package/src/compiler/checker-property-access.ts +906 -0
- package/src/compiler/checker-services.ts +1149 -0
- package/src/compiler/checker-signatures.ts +1032 -0
- package/src/compiler/checker-source-file.ts +732 -0
- package/src/compiler/checker-statements.ts +292 -0
- package/src/compiler/checker-super.ts +261 -0
- package/src/compiler/checker-symbol-types.ts +2107 -0
- package/src/compiler/checker-symbols.ts +2150 -0
- package/src/compiler/checker-type-factory.ts +2579 -0
- package/src/compiler/checker-type-nodes.ts +1033 -0
- package/src/compiler/checker-type-operators.ts +2502 -0
- package/src/compiler/checker-types.ts +2340 -0
- package/src/compiler/checker-unused.ts +642 -0
- package/src/compiler/checker-utilities.ts +161 -0
- package/src/compiler/checker.ts +1116 -0
- package/src/compiler/command-line.ts +436 -0
- package/src/compiler/compile-program.ts +439 -0
- package/src/compiler/decoder.ts +1209 -0
- package/src/compiler/diagnostic-locales.ts +86 -0
- package/src/compiler/diagnostic-messages.ts +2349 -0
- package/src/compiler/diagnostics.ts +897 -0
- package/src/compiler/emitter.ts +434 -0
- package/src/compiler/encoder.ts +1945 -0
- package/src/compiler/file-include.ts +673 -0
- package/src/compiler/file-loader.ts +1528 -0
- package/src/compiler/file-system.ts +143 -0
- package/src/compiler/flow.ts +89 -0
- package/src/compiler/help.ts +473 -0
- package/src/compiler/incremental.ts +2784 -0
- package/src/compiler/init.ts +141 -0
- package/src/compiler/instantiation.ts +894 -0
- package/src/compiler/jsdoc.ts +1386 -0
- package/src/compiler/link-tables.ts +98 -0
- package/src/compiler/locale-data.ts +203 -0
- package/src/compiler/locale.ts +307 -0
- package/src/compiler/locales/cs-CZ.ts +5 -0
- package/src/compiler/locales/de-DE.ts +5 -0
- package/src/compiler/locales/es-ES.ts +5 -0
- package/src/compiler/locales/fr-FR.ts +5 -0
- package/src/compiler/locales/it-IT.ts +5 -0
- package/src/compiler/locales/ja-JP.ts +5 -0
- package/src/compiler/locales/ko-KR.ts +5 -0
- package/src/compiler/locales/pl-PL.ts +5 -0
- package/src/compiler/locales/pt-BR.ts +5 -0
- package/src/compiler/locales/ru-RU.ts +5 -0
- package/src/compiler/locales/tr-TR.ts +5 -0
- package/src/compiler/locales/zh-CN.ts +5 -0
- package/src/compiler/locales/zh-TW.ts +5 -0
- package/src/compiler/module-resolution-types.ts +243 -0
- package/src/compiler/module-resolution.ts +2072 -0
- package/src/compiler/module-specifiers.ts +1491 -0
- package/src/compiler/name-resolver.ts +646 -0
- package/src/compiler/node-builder-names.ts +1069 -0
- package/src/compiler/node-builder-pseudo.ts +892 -0
- package/src/compiler/node-builder-reuse.ts +764 -0
- package/src/compiler/node-builder.ts +3425 -0
- package/src/compiler/option-declarations.ts +1560 -0
- package/src/compiler/options.ts +1576 -0
- package/src/compiler/output-paths.ts +334 -0
- package/src/compiler/package-json.ts +1083 -0
- package/src/compiler/parallel-check.ts +1951 -0
- package/src/compiler/parallel-parse.ts +590 -0
- package/src/compiler/parse-thread.ts +140 -0
- package/src/compiler/parser.ts +7716 -0
- package/src/compiler/path.ts +717 -0
- package/src/compiler/printer/async-helpers.ts +183 -0
- package/src/compiler/printer/auto-generate.ts +27 -0
- package/src/compiler/printer/decorator-helpers.ts +218 -0
- package/src/compiler/printer/emit-context.ts +679 -0
- package/src/compiler/printer/emit-flags.ts +64 -0
- package/src/compiler/printer/factory-base.ts +2577 -0
- package/src/compiler/printer/factory.ts +764 -0
- package/src/compiler/printer/helpers.ts +291 -0
- package/src/compiler/printer/name-generator.ts +372 -0
- package/src/compiler/printer/printer.ts +5072 -0
- package/src/compiler/printer/text-writer.ts +183 -0
- package/src/compiler/printer/utilities.ts +884 -0
- package/src/compiler/program-checker.ts +592 -0
- package/src/compiler/program-utilities.ts +435 -0
- package/src/compiler/program.ts +1419 -0
- package/src/compiler/pseudo-bigint.ts +62 -0
- package/src/compiler/regexp-checker.ts +1142 -0
- package/src/compiler/relations.ts +5149 -0
- package/src/compiler/reparser.ts +1566 -0
- package/src/compiler/scanner.ts +2951 -0
- package/src/compiler/show-config.ts +239 -0
- package/src/compiler/side-state.ts +125 -0
- package/src/compiler/sourcemap.ts +366 -0
- package/src/compiler/spelling.ts +122 -0
- package/src/compiler/symbol-accessibility.ts +1071 -0
- package/src/compiler/symbol.ts +439 -0
- package/src/compiler/symlinks.ts +137 -0
- package/src/compiler/syntax-kind.ts +391 -0
- package/src/compiler/thread-entry.ts +191 -0
- package/src/compiler/timeline.ts +53 -0
- package/src/compiler/transformers/alias-references.ts +757 -0
- package/src/compiler/transformers/async-utilities.ts +335 -0
- package/src/compiler/transformers/async.ts +838 -0
- package/src/compiler/transformers/class-fields.ts +2967 -0
- package/src/compiler/transformers/class-utilities.ts +324 -0
- package/src/compiler/transformers/commonjs-module.ts +1621 -0
- package/src/compiler/transformers/const-enum-inliner.ts +50 -0
- package/src/compiler/transformers/declarations-diagnostics.ts +832 -0
- package/src/compiler/transformers/declarations-pseudo.ts +966 -0
- package/src/compiler/transformers/declarations-resolver.ts +249 -0
- package/src/compiler/transformers/declarations-syntactic.ts +1859 -0
- package/src/compiler/transformers/declarations-tracker.ts +269 -0
- package/src/compiler/transformers/declarations.ts +3120 -0
- package/src/compiler/transformers/decorator-metadata.ts +697 -0
- package/src/compiler/transformers/decorator-utilities.ts +283 -0
- package/src/compiler/transformers/destructuring.ts +708 -0
- package/src/compiler/transformers/downlevel.ts +50 -0
- package/src/compiler/transformers/emit-resolver.ts +258 -0
- package/src/compiler/transformers/es-decorators.ts +2682 -0
- package/src/compiler/transformers/exponentiation.ts +80 -0
- package/src/compiler/transformers/external-module-info.ts +412 -0
- package/src/compiler/transformers/for-await.ts +687 -0
- package/src/compiler/transformers/import-elision.ts +152 -0
- package/src/compiler/transformers/jsx-entities.ts +256 -0
- package/src/compiler/transformers/jsx.ts +824 -0
- package/src/compiler/transformers/legacy-decorators.ts +726 -0
- package/src/compiler/transformers/logical-assignment.ts +75 -0
- package/src/compiler/transformers/module-utilities.ts +42 -0
- package/src/compiler/transformers/module.ts +474 -0
- package/src/compiler/transformers/named-evaluation.ts +389 -0
- package/src/compiler/transformers/nullish-coalescing.ts +35 -0
- package/src/compiler/transformers/object-rest-spread.ts +577 -0
- package/src/compiler/transformers/optional-catch.ts +29 -0
- package/src/compiler/transformers/optional-chain.ts +246 -0
- package/src/compiler/transformers/reference-resolver.ts +1201 -0
- package/src/compiler/transformers/runtime-syntax.ts +942 -0
- package/src/compiler/transformers/subtree-facts.ts +245 -0
- package/src/compiler/transformers/syntax-facts.ts +353 -0
- package/src/compiler/transformers/tagged-template.ts +167 -0
- package/src/compiler/transformers/transformer.ts +56 -0
- package/src/compiler/transformers/type-eraser.ts +520 -0
- package/src/compiler/transformers/type-serialization.ts +374 -0
- package/src/compiler/transformers/using.ts +613 -0
- package/src/compiler/transformers/utilities.ts +419 -0
- package/src/compiler/transformers/visitor-base.ts +1601 -0
- package/src/compiler/transformers/visitor-hooks.ts +252 -0
- package/src/compiler/tsc-build.ts +1418 -0
- package/src/compiler/tsc-cli.ts +666 -0
- package/src/compiler/tsc-compile.ts +437 -0
- package/src/compiler/tsc-watch.ts +854 -0
- package/src/compiler/tsconfig.ts +1574 -0
- package/src/compiler/type-printer.ts +110 -0
- package/src/compiler/types.ts +115 -0
- package/src/compiler/unicode-identifiers.ts +212 -0
- package/src/compiler/unicode-properties.ts +537 -0
- package/src/compiler/vfs-match.ts +597 -0
- package/src/compiler/xxh3.ts +650 -0
- package/src/library/ast.generated.ts +141 -167
- package/src/library/ast.ts +4 -1
- package/src/library/checker.ts +384 -0
- package/src/library/diagnostics.ts +72 -0
- package/src/library/disk.ts +73 -0
- package/src/library/errors.ts +26 -0
- package/src/library/host.ts +63 -0
- package/src/library/index.ts +21 -0
- package/src/library/nodes.ts +232 -0
- package/src/library/options.ts +449 -0
- package/src/library/parse.ts +63 -0
- package/src/library/program.ts +293 -0
- package/src/library/types.ts +14 -1
|
@@ -0,0 +1,1576 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compiler, watch, build and type acquisition options.
|
|
3
|
+
*
|
|
4
|
+
* Unset options are `undefined`; booleans are tristates (`undefined`, `false`, `true`).
|
|
5
|
+
* Enum values match tsgo's, so `0` never appears in a set option.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export enum ScriptTarget {
|
|
9
|
+
/** @deprecated Accepted for parsing and validation only. */
|
|
10
|
+
ES5 = 1,
|
|
11
|
+
ES2015 = 2,
|
|
12
|
+
ES2016 = 3,
|
|
13
|
+
ES2017 = 4,
|
|
14
|
+
ES2018 = 5,
|
|
15
|
+
ES2019 = 6,
|
|
16
|
+
ES2020 = 7,
|
|
17
|
+
ES2021 = 8,
|
|
18
|
+
ES2022 = 9,
|
|
19
|
+
ES2023 = 10,
|
|
20
|
+
ES2024 = 11,
|
|
21
|
+
ES2025 = 12,
|
|
22
|
+
ESNext = 99,
|
|
23
|
+
JSON = 100,
|
|
24
|
+
Latest = ESNext,
|
|
25
|
+
LatestStandard = ES2025,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export enum ModuleKind {
|
|
29
|
+
/** Not an option value: a resolution mode or implied format without a specific module kind. */
|
|
30
|
+
None = 0,
|
|
31
|
+
CommonJS = 1,
|
|
32
|
+
/** @deprecated Accepted for parsing and validation only. */
|
|
33
|
+
AMD = 2,
|
|
34
|
+
/** @deprecated Accepted for parsing and validation only. */
|
|
35
|
+
UMD = 3,
|
|
36
|
+
/** @deprecated Accepted for parsing and validation only. */
|
|
37
|
+
System = 4,
|
|
38
|
+
// ES module kinds stay contiguous from ES2015 to ESNext.
|
|
39
|
+
ES2015 = 5,
|
|
40
|
+
ES2020 = 6,
|
|
41
|
+
ES2022 = 7,
|
|
42
|
+
ESNext = 99,
|
|
43
|
+
Node16 = 100,
|
|
44
|
+
Node18 = 101,
|
|
45
|
+
Node20 = 102,
|
|
46
|
+
NodeNext = 199,
|
|
47
|
+
/** Emit imports and exports as written. */
|
|
48
|
+
Preserve = 200,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export enum ModuleResolutionKind {
|
|
52
|
+
/** @deprecated Accepted for parsing and validation only. */
|
|
53
|
+
Classic = 1,
|
|
54
|
+
/** @deprecated Accepted for parsing and validation only. */
|
|
55
|
+
Node10 = 2,
|
|
56
|
+
Node16 = 3,
|
|
57
|
+
NodeNext = 99,
|
|
58
|
+
Bundler = 100,
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export enum ModuleDetectionKind {
|
|
62
|
+
Auto = 1,
|
|
63
|
+
Legacy = 2,
|
|
64
|
+
Force = 3,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export enum JsxEmit {
|
|
68
|
+
Preserve = 1,
|
|
69
|
+
ReactNative = 2,
|
|
70
|
+
React = 3,
|
|
71
|
+
ReactJSX = 4,
|
|
72
|
+
ReactJSXDev = 5,
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export enum NewLineKind {
|
|
76
|
+
CRLF = 1,
|
|
77
|
+
LF = 2,
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export enum WatchFileKind {
|
|
81
|
+
FixedPollingInterval = 1,
|
|
82
|
+
PriorityPollingInterval = 2,
|
|
83
|
+
DynamicPriorityPolling = 3,
|
|
84
|
+
FixedChunkSizePolling = 4,
|
|
85
|
+
UseFsEvents = 5,
|
|
86
|
+
UseFsEventsOnParentDirectory = 6,
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export enum WatchDirectoryKind {
|
|
90
|
+
UseFsEvents = 1,
|
|
91
|
+
FixedPollingInterval = 2,
|
|
92
|
+
DynamicPriorityPolling = 3,
|
|
93
|
+
FixedChunkSizePolling = 4,
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export enum PollingKind {
|
|
97
|
+
FixedInterval = 1,
|
|
98
|
+
PriorityInterval = 2,
|
|
99
|
+
DynamicPriority = 3,
|
|
100
|
+
FixedChunkSize = 4,
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Compiler options, in tsgo's field order (which `--showConfig` follows).
|
|
105
|
+
*
|
|
106
|
+
* `lib` holds bundled file names (`lib.es2015.d.ts`), not `--lib` names.
|
|
107
|
+
*/
|
|
108
|
+
export interface CompilerOptions {
|
|
109
|
+
allowJs?: boolean;
|
|
110
|
+
allowArbitraryExtensions?: boolean;
|
|
111
|
+
allowImportingTsExtensions?: boolean;
|
|
112
|
+
allowNonTsExtensions?: boolean;
|
|
113
|
+
allowUmdGlobalAccess?: boolean;
|
|
114
|
+
allowUnreachableCode?: boolean;
|
|
115
|
+
allowUnusedLabels?: boolean;
|
|
116
|
+
assumeChangesOnlyAffectDirectDependencies?: boolean;
|
|
117
|
+
checkJs?: boolean;
|
|
118
|
+
customConditions?: string[];
|
|
119
|
+
composite?: boolean;
|
|
120
|
+
emitDeclarationOnly?: boolean;
|
|
121
|
+
emitBOM?: boolean;
|
|
122
|
+
emitDecoratorMetadata?: boolean;
|
|
123
|
+
declaration?: boolean;
|
|
124
|
+
declarationDir?: string;
|
|
125
|
+
declarationMap?: boolean;
|
|
126
|
+
deduplicatePackages?: boolean;
|
|
127
|
+
disableSizeLimit?: boolean;
|
|
128
|
+
disableSourceOfProjectReferenceRedirect?: boolean;
|
|
129
|
+
disableSolutionSearching?: boolean;
|
|
130
|
+
disableReferencedProjectLoad?: boolean;
|
|
131
|
+
erasableSyntaxOnly?: boolean;
|
|
132
|
+
exactOptionalPropertyTypes?: boolean;
|
|
133
|
+
experimentalDecorators?: boolean;
|
|
134
|
+
forceConsistentCasingInFileNames?: boolean;
|
|
135
|
+
isolatedModules?: boolean;
|
|
136
|
+
isolatedDeclarations?: boolean;
|
|
137
|
+
ignoreConfig?: boolean;
|
|
138
|
+
ignoreDeprecations?: string;
|
|
139
|
+
importHelpers?: boolean;
|
|
140
|
+
inlineSourceMap?: boolean;
|
|
141
|
+
inlineSources?: boolean;
|
|
142
|
+
init?: boolean;
|
|
143
|
+
incremental?: boolean;
|
|
144
|
+
jsx?: JsxEmit;
|
|
145
|
+
jsxFactory?: string;
|
|
146
|
+
jsxFragmentFactory?: string;
|
|
147
|
+
jsxImportSource?: string;
|
|
148
|
+
lib?: string[];
|
|
149
|
+
libReplacement?: boolean;
|
|
150
|
+
locale?: string;
|
|
151
|
+
mapRoot?: string;
|
|
152
|
+
module?: ModuleKind;
|
|
153
|
+
moduleResolution?: ModuleResolutionKind;
|
|
154
|
+
moduleSuffixes?: string[];
|
|
155
|
+
moduleDetection?: ModuleDetectionKind;
|
|
156
|
+
newLine?: NewLineKind;
|
|
157
|
+
noEmit?: boolean;
|
|
158
|
+
noCheck?: boolean;
|
|
159
|
+
noErrorTruncation?: boolean;
|
|
160
|
+
noFallthroughCasesInSwitch?: boolean;
|
|
161
|
+
noImplicitAny?: boolean;
|
|
162
|
+
noImplicitThis?: boolean;
|
|
163
|
+
noImplicitReturns?: boolean;
|
|
164
|
+
noEmitHelpers?: boolean;
|
|
165
|
+
noLib?: boolean;
|
|
166
|
+
noPropertyAccessFromIndexSignature?: boolean;
|
|
167
|
+
noUncheckedIndexedAccess?: boolean;
|
|
168
|
+
noEmitOnError?: boolean;
|
|
169
|
+
noUnusedLocals?: boolean;
|
|
170
|
+
noUnusedParameters?: boolean;
|
|
171
|
+
noResolve?: boolean;
|
|
172
|
+
noImplicitOverride?: boolean;
|
|
173
|
+
noUncheckedSideEffectImports?: boolean;
|
|
174
|
+
outDir?: string;
|
|
175
|
+
/** Substitutions are `undefined` where the config gave a non-array. */
|
|
176
|
+
paths?: Map<string, string[] | undefined>;
|
|
177
|
+
preserveConstEnums?: boolean;
|
|
178
|
+
preserveSymlinks?: boolean;
|
|
179
|
+
project?: string;
|
|
180
|
+
resolveJsonModule?: boolean;
|
|
181
|
+
resolvePackageJsonExports?: boolean;
|
|
182
|
+
resolvePackageJsonImports?: boolean;
|
|
183
|
+
removeComments?: boolean;
|
|
184
|
+
rewriteRelativeImportExtensions?: boolean;
|
|
185
|
+
reactNamespace?: string;
|
|
186
|
+
rootDir?: string;
|
|
187
|
+
rootDirs?: string[];
|
|
188
|
+
skipLibCheck?: boolean;
|
|
189
|
+
stableTypeOrdering?: boolean;
|
|
190
|
+
strict?: boolean;
|
|
191
|
+
strictBindCallApply?: boolean;
|
|
192
|
+
strictBuiltinIteratorReturn?: boolean;
|
|
193
|
+
strictFunctionTypes?: boolean;
|
|
194
|
+
strictNullChecks?: boolean;
|
|
195
|
+
strictPropertyInitialization?: boolean;
|
|
196
|
+
stripInternal?: boolean;
|
|
197
|
+
skipDefaultLibCheck?: boolean;
|
|
198
|
+
sourceMap?: boolean;
|
|
199
|
+
sourceRoot?: string;
|
|
200
|
+
suppressOutputPathCheck?: boolean;
|
|
201
|
+
target?: ScriptTarget;
|
|
202
|
+
traceResolution?: boolean;
|
|
203
|
+
tsBuildInfoFile?: string;
|
|
204
|
+
typeRoots?: string[];
|
|
205
|
+
types?: string[];
|
|
206
|
+
useDefineForClassFields?: boolean;
|
|
207
|
+
useUnknownInCatchVariables?: boolean;
|
|
208
|
+
verbatimModuleSyntax?: boolean;
|
|
209
|
+
maxNodeModuleJsDepth?: number;
|
|
210
|
+
allowSyntheticDefaultImports?: boolean;
|
|
211
|
+
alwaysStrict?: boolean;
|
|
212
|
+
baseUrl?: string;
|
|
213
|
+
downlevelIteration?: boolean;
|
|
214
|
+
esModuleInterop?: boolean;
|
|
215
|
+
outFile?: string;
|
|
216
|
+
configFilePath?: string;
|
|
217
|
+
noDtsResolution?: boolean;
|
|
218
|
+
pathsBasePath?: string;
|
|
219
|
+
diagnostics?: boolean;
|
|
220
|
+
extendedDiagnostics?: boolean;
|
|
221
|
+
generateCpuProfile?: string;
|
|
222
|
+
generateTrace?: string;
|
|
223
|
+
listEmittedFiles?: boolean;
|
|
224
|
+
listFiles?: boolean;
|
|
225
|
+
explainFiles?: boolean;
|
|
226
|
+
listFilesOnly?: boolean;
|
|
227
|
+
noEmitForJsFiles?: boolean;
|
|
228
|
+
preserveWatchOutput?: boolean;
|
|
229
|
+
pretty?: boolean;
|
|
230
|
+
version?: boolean;
|
|
231
|
+
watch?: boolean;
|
|
232
|
+
showConfig?: boolean;
|
|
233
|
+
build?: boolean;
|
|
234
|
+
help?: boolean;
|
|
235
|
+
all?: boolean;
|
|
236
|
+
pprofDir?: string;
|
|
237
|
+
singleThreaded?: boolean;
|
|
238
|
+
quiet?: boolean;
|
|
239
|
+
checkers?: number;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface WatchOptions {
|
|
243
|
+
watchInterval?: number;
|
|
244
|
+
watchFile?: WatchFileKind;
|
|
245
|
+
watchDirectory?: WatchDirectoryKind;
|
|
246
|
+
fallbackPolling?: PollingKind;
|
|
247
|
+
synchronousWatchDirectory?: boolean;
|
|
248
|
+
excludeDirectories?: string[];
|
|
249
|
+
excludeFiles?: string[];
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface BuildOptions {
|
|
253
|
+
dry?: boolean;
|
|
254
|
+
force?: boolean;
|
|
255
|
+
verbose?: boolean;
|
|
256
|
+
builders?: number;
|
|
257
|
+
stopBuildOnErrors?: boolean;
|
|
258
|
+
clean?: boolean;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export interface TypeAcquisition {
|
|
262
|
+
enable?: boolean;
|
|
263
|
+
include?: string[];
|
|
264
|
+
exclude?: string[];
|
|
265
|
+
disableFilenameBasedTypeAcquisition?: boolean;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* An option value as parsed from the command line or tsconfig.json.
|
|
270
|
+
*
|
|
271
|
+
* Enum options hold their numeric value; `null` resets an option.
|
|
272
|
+
*/
|
|
273
|
+
export type OptionValue = boolean | number | string | string[] | null;
|
|
274
|
+
|
|
275
|
+
/** A compiler option value as stored in `CompilerOptions`, except `paths`. */
|
|
276
|
+
export type CompilerOptionValue = boolean | number | string | string[];
|
|
277
|
+
|
|
278
|
+
/** Compiler option names in field order. */
|
|
279
|
+
export const compilerOptionNames: readonly string[] = [
|
|
280
|
+
'allowJs',
|
|
281
|
+
'allowArbitraryExtensions',
|
|
282
|
+
'allowImportingTsExtensions',
|
|
283
|
+
'allowNonTsExtensions',
|
|
284
|
+
'allowUmdGlobalAccess',
|
|
285
|
+
'allowUnreachableCode',
|
|
286
|
+
'allowUnusedLabels',
|
|
287
|
+
'assumeChangesOnlyAffectDirectDependencies',
|
|
288
|
+
'checkJs',
|
|
289
|
+
'customConditions',
|
|
290
|
+
'composite',
|
|
291
|
+
'emitDeclarationOnly',
|
|
292
|
+
'emitBOM',
|
|
293
|
+
'emitDecoratorMetadata',
|
|
294
|
+
'declaration',
|
|
295
|
+
'declarationDir',
|
|
296
|
+
'declarationMap',
|
|
297
|
+
'deduplicatePackages',
|
|
298
|
+
'disableSizeLimit',
|
|
299
|
+
'disableSourceOfProjectReferenceRedirect',
|
|
300
|
+
'disableSolutionSearching',
|
|
301
|
+
'disableReferencedProjectLoad',
|
|
302
|
+
'erasableSyntaxOnly',
|
|
303
|
+
'exactOptionalPropertyTypes',
|
|
304
|
+
'experimentalDecorators',
|
|
305
|
+
'forceConsistentCasingInFileNames',
|
|
306
|
+
'isolatedModules',
|
|
307
|
+
'isolatedDeclarations',
|
|
308
|
+
'ignoreConfig',
|
|
309
|
+
'ignoreDeprecations',
|
|
310
|
+
'importHelpers',
|
|
311
|
+
'inlineSourceMap',
|
|
312
|
+
'inlineSources',
|
|
313
|
+
'init',
|
|
314
|
+
'incremental',
|
|
315
|
+
'jsx',
|
|
316
|
+
'jsxFactory',
|
|
317
|
+
'jsxFragmentFactory',
|
|
318
|
+
'jsxImportSource',
|
|
319
|
+
'lib',
|
|
320
|
+
'libReplacement',
|
|
321
|
+
'locale',
|
|
322
|
+
'mapRoot',
|
|
323
|
+
'module',
|
|
324
|
+
'moduleResolution',
|
|
325
|
+
'moduleSuffixes',
|
|
326
|
+
'moduleDetection',
|
|
327
|
+
'newLine',
|
|
328
|
+
'noEmit',
|
|
329
|
+
'noCheck',
|
|
330
|
+
'noErrorTruncation',
|
|
331
|
+
'noFallthroughCasesInSwitch',
|
|
332
|
+
'noImplicitAny',
|
|
333
|
+
'noImplicitThis',
|
|
334
|
+
'noImplicitReturns',
|
|
335
|
+
'noEmitHelpers',
|
|
336
|
+
'noLib',
|
|
337
|
+
'noPropertyAccessFromIndexSignature',
|
|
338
|
+
'noUncheckedIndexedAccess',
|
|
339
|
+
'noEmitOnError',
|
|
340
|
+
'noUnusedLocals',
|
|
341
|
+
'noUnusedParameters',
|
|
342
|
+
'noResolve',
|
|
343
|
+
'noImplicitOverride',
|
|
344
|
+
'noUncheckedSideEffectImports',
|
|
345
|
+
'outDir',
|
|
346
|
+
'paths',
|
|
347
|
+
'preserveConstEnums',
|
|
348
|
+
'preserveSymlinks',
|
|
349
|
+
'project',
|
|
350
|
+
'resolveJsonModule',
|
|
351
|
+
'resolvePackageJsonExports',
|
|
352
|
+
'resolvePackageJsonImports',
|
|
353
|
+
'removeComments',
|
|
354
|
+
'rewriteRelativeImportExtensions',
|
|
355
|
+
'reactNamespace',
|
|
356
|
+
'rootDir',
|
|
357
|
+
'rootDirs',
|
|
358
|
+
'skipLibCheck',
|
|
359
|
+
'stableTypeOrdering',
|
|
360
|
+
'strict',
|
|
361
|
+
'strictBindCallApply',
|
|
362
|
+
'strictBuiltinIteratorReturn',
|
|
363
|
+
'strictFunctionTypes',
|
|
364
|
+
'strictNullChecks',
|
|
365
|
+
'strictPropertyInitialization',
|
|
366
|
+
'stripInternal',
|
|
367
|
+
'skipDefaultLibCheck',
|
|
368
|
+
'sourceMap',
|
|
369
|
+
'sourceRoot',
|
|
370
|
+
'suppressOutputPathCheck',
|
|
371
|
+
'target',
|
|
372
|
+
'traceResolution',
|
|
373
|
+
'tsBuildInfoFile',
|
|
374
|
+
'typeRoots',
|
|
375
|
+
'types',
|
|
376
|
+
'useDefineForClassFields',
|
|
377
|
+
'useUnknownInCatchVariables',
|
|
378
|
+
'verbatimModuleSyntax',
|
|
379
|
+
'maxNodeModuleJsDepth',
|
|
380
|
+
'allowSyntheticDefaultImports',
|
|
381
|
+
'alwaysStrict',
|
|
382
|
+
'baseUrl',
|
|
383
|
+
'downlevelIteration',
|
|
384
|
+
'esModuleInterop',
|
|
385
|
+
'outFile',
|
|
386
|
+
'configFilePath',
|
|
387
|
+
'noDtsResolution',
|
|
388
|
+
'pathsBasePath',
|
|
389
|
+
'diagnostics',
|
|
390
|
+
'extendedDiagnostics',
|
|
391
|
+
'generateCpuProfile',
|
|
392
|
+
'generateTrace',
|
|
393
|
+
'listEmittedFiles',
|
|
394
|
+
'listFiles',
|
|
395
|
+
'explainFiles',
|
|
396
|
+
'listFilesOnly',
|
|
397
|
+
'noEmitForJsFiles',
|
|
398
|
+
'preserveWatchOutput',
|
|
399
|
+
'pretty',
|
|
400
|
+
'version',
|
|
401
|
+
'watch',
|
|
402
|
+
'showConfig',
|
|
403
|
+
'build',
|
|
404
|
+
'help',
|
|
405
|
+
'all',
|
|
406
|
+
'pprofDir',
|
|
407
|
+
'singleThreaded',
|
|
408
|
+
'quiet',
|
|
409
|
+
'checkers',
|
|
410
|
+
];
|
|
411
|
+
|
|
412
|
+
function stringValue(value: OptionValue): string | undefined {
|
|
413
|
+
return typeof value === 'string' && value !== '' ? value : undefined;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function numberValue(value: OptionValue): number | undefined {
|
|
417
|
+
return typeof value === 'number' ? value : undefined;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function stringList(value: OptionValue): string[] | undefined {
|
|
421
|
+
return Array.isArray(value) ? value : undefined;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/** Sets compiler option `name` (a declaration name) from a parsed value. `null` and unknown names are ignored. */
|
|
425
|
+
export function setCompilerOption(options: CompilerOptions, name: string, value: OptionValue): void {
|
|
426
|
+
if (value === null) return;
|
|
427
|
+
switch (name) {
|
|
428
|
+
case 'allowJs':
|
|
429
|
+
options.allowJs = value === true;
|
|
430
|
+
break;
|
|
431
|
+
case 'allowArbitraryExtensions':
|
|
432
|
+
options.allowArbitraryExtensions = value === true;
|
|
433
|
+
break;
|
|
434
|
+
case 'allowImportingTsExtensions':
|
|
435
|
+
options.allowImportingTsExtensions = value === true;
|
|
436
|
+
break;
|
|
437
|
+
case 'allowNonTsExtensions':
|
|
438
|
+
options.allowNonTsExtensions = value === true;
|
|
439
|
+
break;
|
|
440
|
+
case 'allowUmdGlobalAccess':
|
|
441
|
+
options.allowUmdGlobalAccess = value === true;
|
|
442
|
+
break;
|
|
443
|
+
case 'allowUnreachableCode':
|
|
444
|
+
options.allowUnreachableCode = value === true;
|
|
445
|
+
break;
|
|
446
|
+
case 'allowUnusedLabels':
|
|
447
|
+
options.allowUnusedLabels = value === true;
|
|
448
|
+
break;
|
|
449
|
+
case 'assumeChangesOnlyAffectDirectDependencies':
|
|
450
|
+
options.assumeChangesOnlyAffectDirectDependencies = value === true;
|
|
451
|
+
break;
|
|
452
|
+
case 'checkJs':
|
|
453
|
+
options.checkJs = value === true;
|
|
454
|
+
break;
|
|
455
|
+
case 'customConditions':
|
|
456
|
+
options.customConditions = stringList(value);
|
|
457
|
+
break;
|
|
458
|
+
case 'composite':
|
|
459
|
+
options.composite = value === true;
|
|
460
|
+
break;
|
|
461
|
+
case 'emitDeclarationOnly':
|
|
462
|
+
options.emitDeclarationOnly = value === true;
|
|
463
|
+
break;
|
|
464
|
+
case 'emitBOM':
|
|
465
|
+
options.emitBOM = value === true;
|
|
466
|
+
break;
|
|
467
|
+
case 'emitDecoratorMetadata':
|
|
468
|
+
options.emitDecoratorMetadata = value === true;
|
|
469
|
+
break;
|
|
470
|
+
case 'declaration':
|
|
471
|
+
options.declaration = value === true;
|
|
472
|
+
break;
|
|
473
|
+
case 'declarationDir':
|
|
474
|
+
options.declarationDir = stringValue(value);
|
|
475
|
+
break;
|
|
476
|
+
case 'declarationMap':
|
|
477
|
+
options.declarationMap = value === true;
|
|
478
|
+
break;
|
|
479
|
+
case 'deduplicatePackages':
|
|
480
|
+
options.deduplicatePackages = value === true;
|
|
481
|
+
break;
|
|
482
|
+
case 'disableSizeLimit':
|
|
483
|
+
options.disableSizeLimit = value === true;
|
|
484
|
+
break;
|
|
485
|
+
case 'disableSourceOfProjectReferenceRedirect':
|
|
486
|
+
options.disableSourceOfProjectReferenceRedirect = value === true;
|
|
487
|
+
break;
|
|
488
|
+
case 'disableSolutionSearching':
|
|
489
|
+
options.disableSolutionSearching = value === true;
|
|
490
|
+
break;
|
|
491
|
+
case 'disableReferencedProjectLoad':
|
|
492
|
+
options.disableReferencedProjectLoad = value === true;
|
|
493
|
+
break;
|
|
494
|
+
case 'erasableSyntaxOnly':
|
|
495
|
+
options.erasableSyntaxOnly = value === true;
|
|
496
|
+
break;
|
|
497
|
+
case 'exactOptionalPropertyTypes':
|
|
498
|
+
options.exactOptionalPropertyTypes = value === true;
|
|
499
|
+
break;
|
|
500
|
+
case 'experimentalDecorators':
|
|
501
|
+
options.experimentalDecorators = value === true;
|
|
502
|
+
break;
|
|
503
|
+
case 'forceConsistentCasingInFileNames':
|
|
504
|
+
options.forceConsistentCasingInFileNames = value === true;
|
|
505
|
+
break;
|
|
506
|
+
case 'isolatedModules':
|
|
507
|
+
options.isolatedModules = value === true;
|
|
508
|
+
break;
|
|
509
|
+
case 'isolatedDeclarations':
|
|
510
|
+
options.isolatedDeclarations = value === true;
|
|
511
|
+
break;
|
|
512
|
+
case 'ignoreConfig':
|
|
513
|
+
options.ignoreConfig = value === true;
|
|
514
|
+
break;
|
|
515
|
+
case 'ignoreDeprecations':
|
|
516
|
+
options.ignoreDeprecations = stringValue(value);
|
|
517
|
+
break;
|
|
518
|
+
case 'importHelpers':
|
|
519
|
+
options.importHelpers = value === true;
|
|
520
|
+
break;
|
|
521
|
+
case 'inlineSourceMap':
|
|
522
|
+
options.inlineSourceMap = value === true;
|
|
523
|
+
break;
|
|
524
|
+
case 'inlineSources':
|
|
525
|
+
options.inlineSources = value === true;
|
|
526
|
+
break;
|
|
527
|
+
case 'init':
|
|
528
|
+
options.init = value === true;
|
|
529
|
+
break;
|
|
530
|
+
case 'incremental':
|
|
531
|
+
options.incremental = value === true;
|
|
532
|
+
break;
|
|
533
|
+
case 'jsx':
|
|
534
|
+
options.jsx = numberValue(value);
|
|
535
|
+
break;
|
|
536
|
+
case 'jsxFactory':
|
|
537
|
+
options.jsxFactory = stringValue(value);
|
|
538
|
+
break;
|
|
539
|
+
case 'jsxFragmentFactory':
|
|
540
|
+
options.jsxFragmentFactory = stringValue(value);
|
|
541
|
+
break;
|
|
542
|
+
case 'jsxImportSource':
|
|
543
|
+
options.jsxImportSource = stringValue(value);
|
|
544
|
+
break;
|
|
545
|
+
case 'lib':
|
|
546
|
+
options.lib = stringList(value);
|
|
547
|
+
break;
|
|
548
|
+
case 'libReplacement':
|
|
549
|
+
options.libReplacement = value === true;
|
|
550
|
+
break;
|
|
551
|
+
case 'locale':
|
|
552
|
+
options.locale = stringValue(value);
|
|
553
|
+
break;
|
|
554
|
+
case 'mapRoot':
|
|
555
|
+
options.mapRoot = stringValue(value);
|
|
556
|
+
break;
|
|
557
|
+
case 'module':
|
|
558
|
+
options.module = numberValue(value);
|
|
559
|
+
break;
|
|
560
|
+
case 'moduleResolution':
|
|
561
|
+
options.moduleResolution = numberValue(value);
|
|
562
|
+
break;
|
|
563
|
+
case 'moduleSuffixes':
|
|
564
|
+
options.moduleSuffixes = stringList(value);
|
|
565
|
+
break;
|
|
566
|
+
case 'moduleDetection':
|
|
567
|
+
options.moduleDetection = numberValue(value);
|
|
568
|
+
break;
|
|
569
|
+
case 'newLine':
|
|
570
|
+
options.newLine = numberValue(value);
|
|
571
|
+
break;
|
|
572
|
+
case 'noEmit':
|
|
573
|
+
options.noEmit = value === true;
|
|
574
|
+
break;
|
|
575
|
+
case 'noCheck':
|
|
576
|
+
options.noCheck = value === true;
|
|
577
|
+
break;
|
|
578
|
+
case 'noErrorTruncation':
|
|
579
|
+
options.noErrorTruncation = value === true;
|
|
580
|
+
break;
|
|
581
|
+
case 'noFallthroughCasesInSwitch':
|
|
582
|
+
options.noFallthroughCasesInSwitch = value === true;
|
|
583
|
+
break;
|
|
584
|
+
case 'noImplicitAny':
|
|
585
|
+
options.noImplicitAny = value === true;
|
|
586
|
+
break;
|
|
587
|
+
case 'noImplicitThis':
|
|
588
|
+
options.noImplicitThis = value === true;
|
|
589
|
+
break;
|
|
590
|
+
case 'noImplicitReturns':
|
|
591
|
+
options.noImplicitReturns = value === true;
|
|
592
|
+
break;
|
|
593
|
+
case 'noEmitHelpers':
|
|
594
|
+
options.noEmitHelpers = value === true;
|
|
595
|
+
break;
|
|
596
|
+
case 'noLib':
|
|
597
|
+
options.noLib = value === true;
|
|
598
|
+
break;
|
|
599
|
+
case 'noPropertyAccessFromIndexSignature':
|
|
600
|
+
options.noPropertyAccessFromIndexSignature = value === true;
|
|
601
|
+
break;
|
|
602
|
+
case 'noUncheckedIndexedAccess':
|
|
603
|
+
options.noUncheckedIndexedAccess = value === true;
|
|
604
|
+
break;
|
|
605
|
+
case 'noEmitOnError':
|
|
606
|
+
options.noEmitOnError = value === true;
|
|
607
|
+
break;
|
|
608
|
+
case 'noUnusedLocals':
|
|
609
|
+
options.noUnusedLocals = value === true;
|
|
610
|
+
break;
|
|
611
|
+
case 'noUnusedParameters':
|
|
612
|
+
options.noUnusedParameters = value === true;
|
|
613
|
+
break;
|
|
614
|
+
case 'noResolve':
|
|
615
|
+
options.noResolve = value === true;
|
|
616
|
+
break;
|
|
617
|
+
case 'noImplicitOverride':
|
|
618
|
+
options.noImplicitOverride = value === true;
|
|
619
|
+
break;
|
|
620
|
+
case 'noUncheckedSideEffectImports':
|
|
621
|
+
options.noUncheckedSideEffectImports = value === true;
|
|
622
|
+
break;
|
|
623
|
+
case 'outDir':
|
|
624
|
+
options.outDir = stringValue(value);
|
|
625
|
+
break;
|
|
626
|
+
case 'preserveConstEnums':
|
|
627
|
+
options.preserveConstEnums = value === true;
|
|
628
|
+
break;
|
|
629
|
+
case 'preserveSymlinks':
|
|
630
|
+
options.preserveSymlinks = value === true;
|
|
631
|
+
break;
|
|
632
|
+
case 'project':
|
|
633
|
+
options.project = stringValue(value);
|
|
634
|
+
break;
|
|
635
|
+
case 'resolveJsonModule':
|
|
636
|
+
options.resolveJsonModule = value === true;
|
|
637
|
+
break;
|
|
638
|
+
case 'resolvePackageJsonExports':
|
|
639
|
+
options.resolvePackageJsonExports = value === true;
|
|
640
|
+
break;
|
|
641
|
+
case 'resolvePackageJsonImports':
|
|
642
|
+
options.resolvePackageJsonImports = value === true;
|
|
643
|
+
break;
|
|
644
|
+
case 'removeComments':
|
|
645
|
+
options.removeComments = value === true;
|
|
646
|
+
break;
|
|
647
|
+
case 'rewriteRelativeImportExtensions':
|
|
648
|
+
options.rewriteRelativeImportExtensions = value === true;
|
|
649
|
+
break;
|
|
650
|
+
case 'reactNamespace':
|
|
651
|
+
options.reactNamespace = stringValue(value);
|
|
652
|
+
break;
|
|
653
|
+
case 'rootDir':
|
|
654
|
+
options.rootDir = stringValue(value);
|
|
655
|
+
break;
|
|
656
|
+
case 'rootDirs':
|
|
657
|
+
options.rootDirs = stringList(value);
|
|
658
|
+
break;
|
|
659
|
+
case 'skipLibCheck':
|
|
660
|
+
options.skipLibCheck = value === true;
|
|
661
|
+
break;
|
|
662
|
+
case 'stableTypeOrdering':
|
|
663
|
+
options.stableTypeOrdering = value === true;
|
|
664
|
+
break;
|
|
665
|
+
case 'strict':
|
|
666
|
+
options.strict = value === true;
|
|
667
|
+
break;
|
|
668
|
+
case 'strictBindCallApply':
|
|
669
|
+
options.strictBindCallApply = value === true;
|
|
670
|
+
break;
|
|
671
|
+
case 'strictBuiltinIteratorReturn':
|
|
672
|
+
options.strictBuiltinIteratorReturn = value === true;
|
|
673
|
+
break;
|
|
674
|
+
case 'strictFunctionTypes':
|
|
675
|
+
options.strictFunctionTypes = value === true;
|
|
676
|
+
break;
|
|
677
|
+
case 'strictNullChecks':
|
|
678
|
+
options.strictNullChecks = value === true;
|
|
679
|
+
break;
|
|
680
|
+
case 'strictPropertyInitialization':
|
|
681
|
+
options.strictPropertyInitialization = value === true;
|
|
682
|
+
break;
|
|
683
|
+
case 'stripInternal':
|
|
684
|
+
options.stripInternal = value === true;
|
|
685
|
+
break;
|
|
686
|
+
case 'skipDefaultLibCheck':
|
|
687
|
+
options.skipDefaultLibCheck = value === true;
|
|
688
|
+
break;
|
|
689
|
+
case 'sourceMap':
|
|
690
|
+
options.sourceMap = value === true;
|
|
691
|
+
break;
|
|
692
|
+
case 'sourceRoot':
|
|
693
|
+
options.sourceRoot = stringValue(value);
|
|
694
|
+
break;
|
|
695
|
+
case 'suppressOutputPathCheck':
|
|
696
|
+
options.suppressOutputPathCheck = value === true;
|
|
697
|
+
break;
|
|
698
|
+
case 'target':
|
|
699
|
+
options.target = numberValue(value);
|
|
700
|
+
break;
|
|
701
|
+
case 'traceResolution':
|
|
702
|
+
options.traceResolution = value === true;
|
|
703
|
+
break;
|
|
704
|
+
case 'tsBuildInfoFile':
|
|
705
|
+
options.tsBuildInfoFile = stringValue(value);
|
|
706
|
+
break;
|
|
707
|
+
case 'typeRoots':
|
|
708
|
+
options.typeRoots = stringList(value);
|
|
709
|
+
break;
|
|
710
|
+
case 'types':
|
|
711
|
+
options.types = stringList(value);
|
|
712
|
+
break;
|
|
713
|
+
case 'useDefineForClassFields':
|
|
714
|
+
options.useDefineForClassFields = value === true;
|
|
715
|
+
break;
|
|
716
|
+
case 'useUnknownInCatchVariables':
|
|
717
|
+
options.useUnknownInCatchVariables = value === true;
|
|
718
|
+
break;
|
|
719
|
+
case 'verbatimModuleSyntax':
|
|
720
|
+
options.verbatimModuleSyntax = value === true;
|
|
721
|
+
break;
|
|
722
|
+
case 'maxNodeModuleJsDepth':
|
|
723
|
+
options.maxNodeModuleJsDepth = numberValue(value);
|
|
724
|
+
break;
|
|
725
|
+
case 'allowSyntheticDefaultImports':
|
|
726
|
+
options.allowSyntheticDefaultImports = value === true;
|
|
727
|
+
break;
|
|
728
|
+
case 'alwaysStrict':
|
|
729
|
+
options.alwaysStrict = value === true;
|
|
730
|
+
break;
|
|
731
|
+
case 'baseUrl':
|
|
732
|
+
options.baseUrl = stringValue(value);
|
|
733
|
+
break;
|
|
734
|
+
case 'downlevelIteration':
|
|
735
|
+
options.downlevelIteration = value === true;
|
|
736
|
+
break;
|
|
737
|
+
case 'esModuleInterop':
|
|
738
|
+
options.esModuleInterop = value === true;
|
|
739
|
+
break;
|
|
740
|
+
case 'outFile':
|
|
741
|
+
options.outFile = stringValue(value);
|
|
742
|
+
break;
|
|
743
|
+
case 'configFilePath':
|
|
744
|
+
options.configFilePath = stringValue(value);
|
|
745
|
+
break;
|
|
746
|
+
case 'noDtsResolution':
|
|
747
|
+
options.noDtsResolution = value === true;
|
|
748
|
+
break;
|
|
749
|
+
case 'pathsBasePath':
|
|
750
|
+
options.pathsBasePath = stringValue(value);
|
|
751
|
+
break;
|
|
752
|
+
case 'diagnostics':
|
|
753
|
+
options.diagnostics = value === true;
|
|
754
|
+
break;
|
|
755
|
+
case 'extendedDiagnostics':
|
|
756
|
+
options.extendedDiagnostics = value === true;
|
|
757
|
+
break;
|
|
758
|
+
case 'generateCpuProfile':
|
|
759
|
+
options.generateCpuProfile = stringValue(value);
|
|
760
|
+
break;
|
|
761
|
+
case 'generateTrace':
|
|
762
|
+
options.generateTrace = stringValue(value);
|
|
763
|
+
break;
|
|
764
|
+
case 'listEmittedFiles':
|
|
765
|
+
options.listEmittedFiles = value === true;
|
|
766
|
+
break;
|
|
767
|
+
case 'listFiles':
|
|
768
|
+
options.listFiles = value === true;
|
|
769
|
+
break;
|
|
770
|
+
case 'explainFiles':
|
|
771
|
+
options.explainFiles = value === true;
|
|
772
|
+
break;
|
|
773
|
+
case 'listFilesOnly':
|
|
774
|
+
options.listFilesOnly = value === true;
|
|
775
|
+
break;
|
|
776
|
+
case 'noEmitForJsFiles':
|
|
777
|
+
options.noEmitForJsFiles = value === true;
|
|
778
|
+
break;
|
|
779
|
+
case 'preserveWatchOutput':
|
|
780
|
+
options.preserveWatchOutput = value === true;
|
|
781
|
+
break;
|
|
782
|
+
case 'pretty':
|
|
783
|
+
options.pretty = value === true;
|
|
784
|
+
break;
|
|
785
|
+
case 'version':
|
|
786
|
+
options.version = value === true;
|
|
787
|
+
break;
|
|
788
|
+
case 'watch':
|
|
789
|
+
options.watch = value === true;
|
|
790
|
+
break;
|
|
791
|
+
case 'showConfig':
|
|
792
|
+
options.showConfig = value === true;
|
|
793
|
+
break;
|
|
794
|
+
case 'build':
|
|
795
|
+
options.build = value === true;
|
|
796
|
+
break;
|
|
797
|
+
case 'help':
|
|
798
|
+
options.help = value === true;
|
|
799
|
+
break;
|
|
800
|
+
case 'all':
|
|
801
|
+
options.all = value === true;
|
|
802
|
+
break;
|
|
803
|
+
case 'pprofDir':
|
|
804
|
+
options.pprofDir = stringValue(value);
|
|
805
|
+
break;
|
|
806
|
+
case 'singleThreaded':
|
|
807
|
+
options.singleThreaded = value === true;
|
|
808
|
+
break;
|
|
809
|
+
case 'quiet':
|
|
810
|
+
options.quiet = value === true;
|
|
811
|
+
break;
|
|
812
|
+
case 'checkers':
|
|
813
|
+
options.checkers = numberValue(value);
|
|
814
|
+
break;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Sets the options of `target` that are set in `source`, and unsets those named in `nulls`
|
|
820
|
+
* (options given as `null`, which reset inherited values).
|
|
821
|
+
*/
|
|
822
|
+
export function mergeCompilerOptions(
|
|
823
|
+
target: CompilerOptions,
|
|
824
|
+
source: CompilerOptions,
|
|
825
|
+
nulls: ReadonlySet<string> | undefined,
|
|
826
|
+
): CompilerOptions {
|
|
827
|
+
target.allowJs = merged(source.allowJs, target.allowJs, nulls, 'allowJs');
|
|
828
|
+
target.allowArbitraryExtensions = merged(
|
|
829
|
+
source.allowArbitraryExtensions,
|
|
830
|
+
target.allowArbitraryExtensions,
|
|
831
|
+
nulls,
|
|
832
|
+
'allowArbitraryExtensions',
|
|
833
|
+
);
|
|
834
|
+
target.allowImportingTsExtensions = merged(
|
|
835
|
+
source.allowImportingTsExtensions,
|
|
836
|
+
target.allowImportingTsExtensions,
|
|
837
|
+
nulls,
|
|
838
|
+
'allowImportingTsExtensions',
|
|
839
|
+
);
|
|
840
|
+
target.allowNonTsExtensions = merged(
|
|
841
|
+
source.allowNonTsExtensions,
|
|
842
|
+
target.allowNonTsExtensions,
|
|
843
|
+
nulls,
|
|
844
|
+
'allowNonTsExtensions',
|
|
845
|
+
);
|
|
846
|
+
target.allowUmdGlobalAccess = merged(
|
|
847
|
+
source.allowUmdGlobalAccess,
|
|
848
|
+
target.allowUmdGlobalAccess,
|
|
849
|
+
nulls,
|
|
850
|
+
'allowUmdGlobalAccess',
|
|
851
|
+
);
|
|
852
|
+
target.allowUnreachableCode = merged(
|
|
853
|
+
source.allowUnreachableCode,
|
|
854
|
+
target.allowUnreachableCode,
|
|
855
|
+
nulls,
|
|
856
|
+
'allowUnreachableCode',
|
|
857
|
+
);
|
|
858
|
+
target.allowUnusedLabels = merged(source.allowUnusedLabels, target.allowUnusedLabels, nulls, 'allowUnusedLabels');
|
|
859
|
+
target.assumeChangesOnlyAffectDirectDependencies = merged(
|
|
860
|
+
source.assumeChangesOnlyAffectDirectDependencies,
|
|
861
|
+
target.assumeChangesOnlyAffectDirectDependencies,
|
|
862
|
+
nulls,
|
|
863
|
+
'assumeChangesOnlyAffectDirectDependencies',
|
|
864
|
+
);
|
|
865
|
+
target.checkJs = merged(source.checkJs, target.checkJs, nulls, 'checkJs');
|
|
866
|
+
target.customConditions = merged(source.customConditions, target.customConditions, nulls, 'customConditions');
|
|
867
|
+
target.composite = merged(source.composite, target.composite, nulls, 'composite');
|
|
868
|
+
target.emitDeclarationOnly = merged(
|
|
869
|
+
source.emitDeclarationOnly,
|
|
870
|
+
target.emitDeclarationOnly,
|
|
871
|
+
nulls,
|
|
872
|
+
'emitDeclarationOnly',
|
|
873
|
+
);
|
|
874
|
+
target.emitBOM = merged(source.emitBOM, target.emitBOM, nulls, 'emitBOM');
|
|
875
|
+
target.emitDecoratorMetadata = merged(
|
|
876
|
+
source.emitDecoratorMetadata,
|
|
877
|
+
target.emitDecoratorMetadata,
|
|
878
|
+
nulls,
|
|
879
|
+
'emitDecoratorMetadata',
|
|
880
|
+
);
|
|
881
|
+
target.declaration = merged(source.declaration, target.declaration, nulls, 'declaration');
|
|
882
|
+
target.declarationDir = merged(source.declarationDir, target.declarationDir, nulls, 'declarationDir');
|
|
883
|
+
target.declarationMap = merged(source.declarationMap, target.declarationMap, nulls, 'declarationMap');
|
|
884
|
+
target.deduplicatePackages = merged(
|
|
885
|
+
source.deduplicatePackages,
|
|
886
|
+
target.deduplicatePackages,
|
|
887
|
+
nulls,
|
|
888
|
+
'deduplicatePackages',
|
|
889
|
+
);
|
|
890
|
+
target.disableSizeLimit = merged(source.disableSizeLimit, target.disableSizeLimit, nulls, 'disableSizeLimit');
|
|
891
|
+
target.disableSourceOfProjectReferenceRedirect = merged(
|
|
892
|
+
source.disableSourceOfProjectReferenceRedirect,
|
|
893
|
+
target.disableSourceOfProjectReferenceRedirect,
|
|
894
|
+
nulls,
|
|
895
|
+
'disableSourceOfProjectReferenceRedirect',
|
|
896
|
+
);
|
|
897
|
+
target.disableSolutionSearching = merged(
|
|
898
|
+
source.disableSolutionSearching,
|
|
899
|
+
target.disableSolutionSearching,
|
|
900
|
+
nulls,
|
|
901
|
+
'disableSolutionSearching',
|
|
902
|
+
);
|
|
903
|
+
target.disableReferencedProjectLoad = merged(
|
|
904
|
+
source.disableReferencedProjectLoad,
|
|
905
|
+
target.disableReferencedProjectLoad,
|
|
906
|
+
nulls,
|
|
907
|
+
'disableReferencedProjectLoad',
|
|
908
|
+
);
|
|
909
|
+
target.erasableSyntaxOnly = merged(source.erasableSyntaxOnly, target.erasableSyntaxOnly, nulls, 'erasableSyntaxOnly');
|
|
910
|
+
target.exactOptionalPropertyTypes = merged(
|
|
911
|
+
source.exactOptionalPropertyTypes,
|
|
912
|
+
target.exactOptionalPropertyTypes,
|
|
913
|
+
nulls,
|
|
914
|
+
'exactOptionalPropertyTypes',
|
|
915
|
+
);
|
|
916
|
+
target.experimentalDecorators = merged(
|
|
917
|
+
source.experimentalDecorators,
|
|
918
|
+
target.experimentalDecorators,
|
|
919
|
+
nulls,
|
|
920
|
+
'experimentalDecorators',
|
|
921
|
+
);
|
|
922
|
+
target.forceConsistentCasingInFileNames = merged(
|
|
923
|
+
source.forceConsistentCasingInFileNames,
|
|
924
|
+
target.forceConsistentCasingInFileNames,
|
|
925
|
+
nulls,
|
|
926
|
+
'forceConsistentCasingInFileNames',
|
|
927
|
+
);
|
|
928
|
+
target.isolatedModules = merged(source.isolatedModules, target.isolatedModules, nulls, 'isolatedModules');
|
|
929
|
+
target.isolatedDeclarations = merged(
|
|
930
|
+
source.isolatedDeclarations,
|
|
931
|
+
target.isolatedDeclarations,
|
|
932
|
+
nulls,
|
|
933
|
+
'isolatedDeclarations',
|
|
934
|
+
);
|
|
935
|
+
target.ignoreConfig = merged(source.ignoreConfig, target.ignoreConfig, nulls, 'ignoreConfig');
|
|
936
|
+
target.ignoreDeprecations = merged(source.ignoreDeprecations, target.ignoreDeprecations, nulls, 'ignoreDeprecations');
|
|
937
|
+
target.importHelpers = merged(source.importHelpers, target.importHelpers, nulls, 'importHelpers');
|
|
938
|
+
target.inlineSourceMap = merged(source.inlineSourceMap, target.inlineSourceMap, nulls, 'inlineSourceMap');
|
|
939
|
+
target.inlineSources = merged(source.inlineSources, target.inlineSources, nulls, 'inlineSources');
|
|
940
|
+
target.init = merged(source.init, target.init, nulls, 'init');
|
|
941
|
+
target.incremental = merged(source.incremental, target.incremental, nulls, 'incremental');
|
|
942
|
+
target.jsx = merged(source.jsx, target.jsx, nulls, 'jsx');
|
|
943
|
+
target.jsxFactory = merged(source.jsxFactory, target.jsxFactory, nulls, 'jsxFactory');
|
|
944
|
+
target.jsxFragmentFactory = merged(source.jsxFragmentFactory, target.jsxFragmentFactory, nulls, 'jsxFragmentFactory');
|
|
945
|
+
target.jsxImportSource = merged(source.jsxImportSource, target.jsxImportSource, nulls, 'jsxImportSource');
|
|
946
|
+
target.lib = merged(source.lib, target.lib, nulls, 'lib');
|
|
947
|
+
target.libReplacement = merged(source.libReplacement, target.libReplacement, nulls, 'libReplacement');
|
|
948
|
+
target.locale = merged(source.locale, target.locale, nulls, 'locale');
|
|
949
|
+
target.mapRoot = merged(source.mapRoot, target.mapRoot, nulls, 'mapRoot');
|
|
950
|
+
target.module = merged(source.module, target.module, nulls, 'module');
|
|
951
|
+
target.moduleResolution = merged(source.moduleResolution, target.moduleResolution, nulls, 'moduleResolution');
|
|
952
|
+
target.moduleSuffixes = merged(source.moduleSuffixes, target.moduleSuffixes, nulls, 'moduleSuffixes');
|
|
953
|
+
target.moduleDetection = merged(source.moduleDetection, target.moduleDetection, nulls, 'moduleDetection');
|
|
954
|
+
target.newLine = merged(source.newLine, target.newLine, nulls, 'newLine');
|
|
955
|
+
target.noEmit = merged(source.noEmit, target.noEmit, nulls, 'noEmit');
|
|
956
|
+
target.noCheck = merged(source.noCheck, target.noCheck, nulls, 'noCheck');
|
|
957
|
+
target.noErrorTruncation = merged(source.noErrorTruncation, target.noErrorTruncation, nulls, 'noErrorTruncation');
|
|
958
|
+
target.noFallthroughCasesInSwitch = merged(
|
|
959
|
+
source.noFallthroughCasesInSwitch,
|
|
960
|
+
target.noFallthroughCasesInSwitch,
|
|
961
|
+
nulls,
|
|
962
|
+
'noFallthroughCasesInSwitch',
|
|
963
|
+
);
|
|
964
|
+
target.noImplicitAny = merged(source.noImplicitAny, target.noImplicitAny, nulls, 'noImplicitAny');
|
|
965
|
+
target.noImplicitThis = merged(source.noImplicitThis, target.noImplicitThis, nulls, 'noImplicitThis');
|
|
966
|
+
target.noImplicitReturns = merged(source.noImplicitReturns, target.noImplicitReturns, nulls, 'noImplicitReturns');
|
|
967
|
+
target.noEmitHelpers = merged(source.noEmitHelpers, target.noEmitHelpers, nulls, 'noEmitHelpers');
|
|
968
|
+
target.noLib = merged(source.noLib, target.noLib, nulls, 'noLib');
|
|
969
|
+
target.noPropertyAccessFromIndexSignature = merged(
|
|
970
|
+
source.noPropertyAccessFromIndexSignature,
|
|
971
|
+
target.noPropertyAccessFromIndexSignature,
|
|
972
|
+
nulls,
|
|
973
|
+
'noPropertyAccessFromIndexSignature',
|
|
974
|
+
);
|
|
975
|
+
target.noUncheckedIndexedAccess = merged(
|
|
976
|
+
source.noUncheckedIndexedAccess,
|
|
977
|
+
target.noUncheckedIndexedAccess,
|
|
978
|
+
nulls,
|
|
979
|
+
'noUncheckedIndexedAccess',
|
|
980
|
+
);
|
|
981
|
+
target.noEmitOnError = merged(source.noEmitOnError, target.noEmitOnError, nulls, 'noEmitOnError');
|
|
982
|
+
target.noUnusedLocals = merged(source.noUnusedLocals, target.noUnusedLocals, nulls, 'noUnusedLocals');
|
|
983
|
+
target.noUnusedParameters = merged(source.noUnusedParameters, target.noUnusedParameters, nulls, 'noUnusedParameters');
|
|
984
|
+
target.noResolve = merged(source.noResolve, target.noResolve, nulls, 'noResolve');
|
|
985
|
+
target.noImplicitOverride = merged(source.noImplicitOverride, target.noImplicitOverride, nulls, 'noImplicitOverride');
|
|
986
|
+
target.noUncheckedSideEffectImports = merged(
|
|
987
|
+
source.noUncheckedSideEffectImports,
|
|
988
|
+
target.noUncheckedSideEffectImports,
|
|
989
|
+
nulls,
|
|
990
|
+
'noUncheckedSideEffectImports',
|
|
991
|
+
);
|
|
992
|
+
target.outDir = merged(source.outDir, target.outDir, nulls, 'outDir');
|
|
993
|
+
target.paths = merged(source.paths, target.paths, nulls, 'paths');
|
|
994
|
+
target.preserveConstEnums = merged(source.preserveConstEnums, target.preserveConstEnums, nulls, 'preserveConstEnums');
|
|
995
|
+
target.preserveSymlinks = merged(source.preserveSymlinks, target.preserveSymlinks, nulls, 'preserveSymlinks');
|
|
996
|
+
target.project = merged(source.project, target.project, nulls, 'project');
|
|
997
|
+
target.resolveJsonModule = merged(source.resolveJsonModule, target.resolveJsonModule, nulls, 'resolveJsonModule');
|
|
998
|
+
target.resolvePackageJsonExports = merged(
|
|
999
|
+
source.resolvePackageJsonExports,
|
|
1000
|
+
target.resolvePackageJsonExports,
|
|
1001
|
+
nulls,
|
|
1002
|
+
'resolvePackageJsonExports',
|
|
1003
|
+
);
|
|
1004
|
+
target.resolvePackageJsonImports = merged(
|
|
1005
|
+
source.resolvePackageJsonImports,
|
|
1006
|
+
target.resolvePackageJsonImports,
|
|
1007
|
+
nulls,
|
|
1008
|
+
'resolvePackageJsonImports',
|
|
1009
|
+
);
|
|
1010
|
+
target.removeComments = merged(source.removeComments, target.removeComments, nulls, 'removeComments');
|
|
1011
|
+
target.rewriteRelativeImportExtensions = merged(
|
|
1012
|
+
source.rewriteRelativeImportExtensions,
|
|
1013
|
+
target.rewriteRelativeImportExtensions,
|
|
1014
|
+
nulls,
|
|
1015
|
+
'rewriteRelativeImportExtensions',
|
|
1016
|
+
);
|
|
1017
|
+
target.reactNamespace = merged(source.reactNamespace, target.reactNamespace, nulls, 'reactNamespace');
|
|
1018
|
+
target.rootDir = merged(source.rootDir, target.rootDir, nulls, 'rootDir');
|
|
1019
|
+
target.rootDirs = merged(source.rootDirs, target.rootDirs, nulls, 'rootDirs');
|
|
1020
|
+
target.skipLibCheck = merged(source.skipLibCheck, target.skipLibCheck, nulls, 'skipLibCheck');
|
|
1021
|
+
target.stableTypeOrdering = merged(source.stableTypeOrdering, target.stableTypeOrdering, nulls, 'stableTypeOrdering');
|
|
1022
|
+
target.strict = merged(source.strict, target.strict, nulls, 'strict');
|
|
1023
|
+
target.strictBindCallApply = merged(
|
|
1024
|
+
source.strictBindCallApply,
|
|
1025
|
+
target.strictBindCallApply,
|
|
1026
|
+
nulls,
|
|
1027
|
+
'strictBindCallApply',
|
|
1028
|
+
);
|
|
1029
|
+
target.strictBuiltinIteratorReturn = merged(
|
|
1030
|
+
source.strictBuiltinIteratorReturn,
|
|
1031
|
+
target.strictBuiltinIteratorReturn,
|
|
1032
|
+
nulls,
|
|
1033
|
+
'strictBuiltinIteratorReturn',
|
|
1034
|
+
);
|
|
1035
|
+
target.strictFunctionTypes = merged(
|
|
1036
|
+
source.strictFunctionTypes,
|
|
1037
|
+
target.strictFunctionTypes,
|
|
1038
|
+
nulls,
|
|
1039
|
+
'strictFunctionTypes',
|
|
1040
|
+
);
|
|
1041
|
+
target.strictNullChecks = merged(source.strictNullChecks, target.strictNullChecks, nulls, 'strictNullChecks');
|
|
1042
|
+
target.strictPropertyInitialization = merged(
|
|
1043
|
+
source.strictPropertyInitialization,
|
|
1044
|
+
target.strictPropertyInitialization,
|
|
1045
|
+
nulls,
|
|
1046
|
+
'strictPropertyInitialization',
|
|
1047
|
+
);
|
|
1048
|
+
target.stripInternal = merged(source.stripInternal, target.stripInternal, nulls, 'stripInternal');
|
|
1049
|
+
target.skipDefaultLibCheck = merged(
|
|
1050
|
+
source.skipDefaultLibCheck,
|
|
1051
|
+
target.skipDefaultLibCheck,
|
|
1052
|
+
nulls,
|
|
1053
|
+
'skipDefaultLibCheck',
|
|
1054
|
+
);
|
|
1055
|
+
target.sourceMap = merged(source.sourceMap, target.sourceMap, nulls, 'sourceMap');
|
|
1056
|
+
target.sourceRoot = merged(source.sourceRoot, target.sourceRoot, nulls, 'sourceRoot');
|
|
1057
|
+
target.suppressOutputPathCheck = merged(
|
|
1058
|
+
source.suppressOutputPathCheck,
|
|
1059
|
+
target.suppressOutputPathCheck,
|
|
1060
|
+
nulls,
|
|
1061
|
+
'suppressOutputPathCheck',
|
|
1062
|
+
);
|
|
1063
|
+
target.target = merged(source.target, target.target, nulls, 'target');
|
|
1064
|
+
target.traceResolution = merged(source.traceResolution, target.traceResolution, nulls, 'traceResolution');
|
|
1065
|
+
target.tsBuildInfoFile = merged(source.tsBuildInfoFile, target.tsBuildInfoFile, nulls, 'tsBuildInfoFile');
|
|
1066
|
+
target.typeRoots = merged(source.typeRoots, target.typeRoots, nulls, 'typeRoots');
|
|
1067
|
+
target.types = merged(source.types, target.types, nulls, 'types');
|
|
1068
|
+
target.useDefineForClassFields = merged(
|
|
1069
|
+
source.useDefineForClassFields,
|
|
1070
|
+
target.useDefineForClassFields,
|
|
1071
|
+
nulls,
|
|
1072
|
+
'useDefineForClassFields',
|
|
1073
|
+
);
|
|
1074
|
+
target.useUnknownInCatchVariables = merged(
|
|
1075
|
+
source.useUnknownInCatchVariables,
|
|
1076
|
+
target.useUnknownInCatchVariables,
|
|
1077
|
+
nulls,
|
|
1078
|
+
'useUnknownInCatchVariables',
|
|
1079
|
+
);
|
|
1080
|
+
target.verbatimModuleSyntax = merged(
|
|
1081
|
+
source.verbatimModuleSyntax,
|
|
1082
|
+
target.verbatimModuleSyntax,
|
|
1083
|
+
nulls,
|
|
1084
|
+
'verbatimModuleSyntax',
|
|
1085
|
+
);
|
|
1086
|
+
target.maxNodeModuleJsDepth = merged(
|
|
1087
|
+
source.maxNodeModuleJsDepth,
|
|
1088
|
+
target.maxNodeModuleJsDepth,
|
|
1089
|
+
nulls,
|
|
1090
|
+
'maxNodeModuleJsDepth',
|
|
1091
|
+
);
|
|
1092
|
+
target.allowSyntheticDefaultImports = merged(
|
|
1093
|
+
source.allowSyntheticDefaultImports,
|
|
1094
|
+
target.allowSyntheticDefaultImports,
|
|
1095
|
+
nulls,
|
|
1096
|
+
'allowSyntheticDefaultImports',
|
|
1097
|
+
);
|
|
1098
|
+
target.alwaysStrict = merged(source.alwaysStrict, target.alwaysStrict, nulls, 'alwaysStrict');
|
|
1099
|
+
target.baseUrl = merged(source.baseUrl, target.baseUrl, nulls, 'baseUrl');
|
|
1100
|
+
target.downlevelIteration = merged(source.downlevelIteration, target.downlevelIteration, nulls, 'downlevelIteration');
|
|
1101
|
+
target.esModuleInterop = merged(source.esModuleInterop, target.esModuleInterop, nulls, 'esModuleInterop');
|
|
1102
|
+
target.outFile = merged(source.outFile, target.outFile, nulls, 'outFile');
|
|
1103
|
+
target.configFilePath = merged(source.configFilePath, target.configFilePath, nulls, 'configFilePath');
|
|
1104
|
+
target.noDtsResolution = merged(source.noDtsResolution, target.noDtsResolution, nulls, 'noDtsResolution');
|
|
1105
|
+
target.pathsBasePath = merged(source.pathsBasePath, target.pathsBasePath, nulls, 'pathsBasePath');
|
|
1106
|
+
target.diagnostics = merged(source.diagnostics, target.diagnostics, nulls, 'diagnostics');
|
|
1107
|
+
target.extendedDiagnostics = merged(
|
|
1108
|
+
source.extendedDiagnostics,
|
|
1109
|
+
target.extendedDiagnostics,
|
|
1110
|
+
nulls,
|
|
1111
|
+
'extendedDiagnostics',
|
|
1112
|
+
);
|
|
1113
|
+
target.generateCpuProfile = merged(source.generateCpuProfile, target.generateCpuProfile, nulls, 'generateCpuProfile');
|
|
1114
|
+
target.generateTrace = merged(source.generateTrace, target.generateTrace, nulls, 'generateTrace');
|
|
1115
|
+
target.listEmittedFiles = merged(source.listEmittedFiles, target.listEmittedFiles, nulls, 'listEmittedFiles');
|
|
1116
|
+
target.listFiles = merged(source.listFiles, target.listFiles, nulls, 'listFiles');
|
|
1117
|
+
target.explainFiles = merged(source.explainFiles, target.explainFiles, nulls, 'explainFiles');
|
|
1118
|
+
target.listFilesOnly = merged(source.listFilesOnly, target.listFilesOnly, nulls, 'listFilesOnly');
|
|
1119
|
+
target.noEmitForJsFiles = merged(source.noEmitForJsFiles, target.noEmitForJsFiles, nulls, 'noEmitForJsFiles');
|
|
1120
|
+
target.preserveWatchOutput = merged(
|
|
1121
|
+
source.preserveWatchOutput,
|
|
1122
|
+
target.preserveWatchOutput,
|
|
1123
|
+
nulls,
|
|
1124
|
+
'preserveWatchOutput',
|
|
1125
|
+
);
|
|
1126
|
+
target.pretty = merged(source.pretty, target.pretty, nulls, 'pretty');
|
|
1127
|
+
target.version = merged(source.version, target.version, nulls, 'version');
|
|
1128
|
+
target.watch = merged(source.watch, target.watch, nulls, 'watch');
|
|
1129
|
+
target.showConfig = merged(source.showConfig, target.showConfig, nulls, 'showConfig');
|
|
1130
|
+
target.build = merged(source.build, target.build, nulls, 'build');
|
|
1131
|
+
target.help = merged(source.help, target.help, nulls, 'help');
|
|
1132
|
+
target.all = merged(source.all, target.all, nulls, 'all');
|
|
1133
|
+
target.pprofDir = merged(source.pprofDir, target.pprofDir, nulls, 'pprofDir');
|
|
1134
|
+
target.singleThreaded = merged(source.singleThreaded, target.singleThreaded, nulls, 'singleThreaded');
|
|
1135
|
+
target.quiet = merged(source.quiet, target.quiet, nulls, 'quiet');
|
|
1136
|
+
target.checkers = merged(source.checkers, target.checkers, nulls, 'checkers');
|
|
1137
|
+
return target;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
function merged<T>(
|
|
1141
|
+
source: T | undefined,
|
|
1142
|
+
target: T | undefined,
|
|
1143
|
+
nulls: ReadonlySet<string> | undefined,
|
|
1144
|
+
name: string,
|
|
1145
|
+
): T | undefined {
|
|
1146
|
+
if (nulls !== undefined && nulls.has(name)) return undefined;
|
|
1147
|
+
return source === undefined ? target : source;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
export function getCompilerOption(options: CompilerOptions, name: string): CompilerOptionValue | undefined {
|
|
1151
|
+
switch (name) {
|
|
1152
|
+
case 'allowJs':
|
|
1153
|
+
return options.allowJs;
|
|
1154
|
+
case 'allowArbitraryExtensions':
|
|
1155
|
+
return options.allowArbitraryExtensions;
|
|
1156
|
+
case 'allowImportingTsExtensions':
|
|
1157
|
+
return options.allowImportingTsExtensions;
|
|
1158
|
+
case 'allowNonTsExtensions':
|
|
1159
|
+
return options.allowNonTsExtensions;
|
|
1160
|
+
case 'allowUmdGlobalAccess':
|
|
1161
|
+
return options.allowUmdGlobalAccess;
|
|
1162
|
+
case 'allowUnreachableCode':
|
|
1163
|
+
return options.allowUnreachableCode;
|
|
1164
|
+
case 'allowUnusedLabels':
|
|
1165
|
+
return options.allowUnusedLabels;
|
|
1166
|
+
case 'assumeChangesOnlyAffectDirectDependencies':
|
|
1167
|
+
return options.assumeChangesOnlyAffectDirectDependencies;
|
|
1168
|
+
case 'checkJs':
|
|
1169
|
+
return options.checkJs;
|
|
1170
|
+
case 'customConditions':
|
|
1171
|
+
return options.customConditions;
|
|
1172
|
+
case 'composite':
|
|
1173
|
+
return options.composite;
|
|
1174
|
+
case 'emitDeclarationOnly':
|
|
1175
|
+
return options.emitDeclarationOnly;
|
|
1176
|
+
case 'emitBOM':
|
|
1177
|
+
return options.emitBOM;
|
|
1178
|
+
case 'emitDecoratorMetadata':
|
|
1179
|
+
return options.emitDecoratorMetadata;
|
|
1180
|
+
case 'declaration':
|
|
1181
|
+
return options.declaration;
|
|
1182
|
+
case 'declarationDir':
|
|
1183
|
+
return options.declarationDir;
|
|
1184
|
+
case 'declarationMap':
|
|
1185
|
+
return options.declarationMap;
|
|
1186
|
+
case 'deduplicatePackages':
|
|
1187
|
+
return options.deduplicatePackages;
|
|
1188
|
+
case 'disableSizeLimit':
|
|
1189
|
+
return options.disableSizeLimit;
|
|
1190
|
+
case 'disableSourceOfProjectReferenceRedirect':
|
|
1191
|
+
return options.disableSourceOfProjectReferenceRedirect;
|
|
1192
|
+
case 'disableSolutionSearching':
|
|
1193
|
+
return options.disableSolutionSearching;
|
|
1194
|
+
case 'disableReferencedProjectLoad':
|
|
1195
|
+
return options.disableReferencedProjectLoad;
|
|
1196
|
+
case 'erasableSyntaxOnly':
|
|
1197
|
+
return options.erasableSyntaxOnly;
|
|
1198
|
+
case 'exactOptionalPropertyTypes':
|
|
1199
|
+
return options.exactOptionalPropertyTypes;
|
|
1200
|
+
case 'experimentalDecorators':
|
|
1201
|
+
return options.experimentalDecorators;
|
|
1202
|
+
case 'forceConsistentCasingInFileNames':
|
|
1203
|
+
return options.forceConsistentCasingInFileNames;
|
|
1204
|
+
case 'isolatedModules':
|
|
1205
|
+
return options.isolatedModules;
|
|
1206
|
+
case 'isolatedDeclarations':
|
|
1207
|
+
return options.isolatedDeclarations;
|
|
1208
|
+
case 'ignoreConfig':
|
|
1209
|
+
return options.ignoreConfig;
|
|
1210
|
+
case 'ignoreDeprecations':
|
|
1211
|
+
return options.ignoreDeprecations;
|
|
1212
|
+
case 'importHelpers':
|
|
1213
|
+
return options.importHelpers;
|
|
1214
|
+
case 'inlineSourceMap':
|
|
1215
|
+
return options.inlineSourceMap;
|
|
1216
|
+
case 'inlineSources':
|
|
1217
|
+
return options.inlineSources;
|
|
1218
|
+
case 'init':
|
|
1219
|
+
return options.init;
|
|
1220
|
+
case 'incremental':
|
|
1221
|
+
return options.incremental;
|
|
1222
|
+
case 'jsx':
|
|
1223
|
+
return options.jsx;
|
|
1224
|
+
case 'jsxFactory':
|
|
1225
|
+
return options.jsxFactory;
|
|
1226
|
+
case 'jsxFragmentFactory':
|
|
1227
|
+
return options.jsxFragmentFactory;
|
|
1228
|
+
case 'jsxImportSource':
|
|
1229
|
+
return options.jsxImportSource;
|
|
1230
|
+
case 'lib':
|
|
1231
|
+
return options.lib;
|
|
1232
|
+
case 'libReplacement':
|
|
1233
|
+
return options.libReplacement;
|
|
1234
|
+
case 'locale':
|
|
1235
|
+
return options.locale;
|
|
1236
|
+
case 'mapRoot':
|
|
1237
|
+
return options.mapRoot;
|
|
1238
|
+
case 'module':
|
|
1239
|
+
return options.module;
|
|
1240
|
+
case 'moduleResolution':
|
|
1241
|
+
return options.moduleResolution;
|
|
1242
|
+
case 'moduleSuffixes':
|
|
1243
|
+
return options.moduleSuffixes;
|
|
1244
|
+
case 'moduleDetection':
|
|
1245
|
+
return options.moduleDetection;
|
|
1246
|
+
case 'newLine':
|
|
1247
|
+
return options.newLine;
|
|
1248
|
+
case 'noEmit':
|
|
1249
|
+
return options.noEmit;
|
|
1250
|
+
case 'noCheck':
|
|
1251
|
+
return options.noCheck;
|
|
1252
|
+
case 'noErrorTruncation':
|
|
1253
|
+
return options.noErrorTruncation;
|
|
1254
|
+
case 'noFallthroughCasesInSwitch':
|
|
1255
|
+
return options.noFallthroughCasesInSwitch;
|
|
1256
|
+
case 'noImplicitAny':
|
|
1257
|
+
return options.noImplicitAny;
|
|
1258
|
+
case 'noImplicitThis':
|
|
1259
|
+
return options.noImplicitThis;
|
|
1260
|
+
case 'noImplicitReturns':
|
|
1261
|
+
return options.noImplicitReturns;
|
|
1262
|
+
case 'noEmitHelpers':
|
|
1263
|
+
return options.noEmitHelpers;
|
|
1264
|
+
case 'noLib':
|
|
1265
|
+
return options.noLib;
|
|
1266
|
+
case 'noPropertyAccessFromIndexSignature':
|
|
1267
|
+
return options.noPropertyAccessFromIndexSignature;
|
|
1268
|
+
case 'noUncheckedIndexedAccess':
|
|
1269
|
+
return options.noUncheckedIndexedAccess;
|
|
1270
|
+
case 'noEmitOnError':
|
|
1271
|
+
return options.noEmitOnError;
|
|
1272
|
+
case 'noUnusedLocals':
|
|
1273
|
+
return options.noUnusedLocals;
|
|
1274
|
+
case 'noUnusedParameters':
|
|
1275
|
+
return options.noUnusedParameters;
|
|
1276
|
+
case 'noResolve':
|
|
1277
|
+
return options.noResolve;
|
|
1278
|
+
case 'noImplicitOverride':
|
|
1279
|
+
return options.noImplicitOverride;
|
|
1280
|
+
case 'noUncheckedSideEffectImports':
|
|
1281
|
+
return options.noUncheckedSideEffectImports;
|
|
1282
|
+
case 'outDir':
|
|
1283
|
+
return options.outDir;
|
|
1284
|
+
case 'preserveConstEnums':
|
|
1285
|
+
return options.preserveConstEnums;
|
|
1286
|
+
case 'preserveSymlinks':
|
|
1287
|
+
return options.preserveSymlinks;
|
|
1288
|
+
case 'project':
|
|
1289
|
+
return options.project;
|
|
1290
|
+
case 'resolveJsonModule':
|
|
1291
|
+
return options.resolveJsonModule;
|
|
1292
|
+
case 'resolvePackageJsonExports':
|
|
1293
|
+
return options.resolvePackageJsonExports;
|
|
1294
|
+
case 'resolvePackageJsonImports':
|
|
1295
|
+
return options.resolvePackageJsonImports;
|
|
1296
|
+
case 'removeComments':
|
|
1297
|
+
return options.removeComments;
|
|
1298
|
+
case 'rewriteRelativeImportExtensions':
|
|
1299
|
+
return options.rewriteRelativeImportExtensions;
|
|
1300
|
+
case 'reactNamespace':
|
|
1301
|
+
return options.reactNamespace;
|
|
1302
|
+
case 'rootDir':
|
|
1303
|
+
return options.rootDir;
|
|
1304
|
+
case 'rootDirs':
|
|
1305
|
+
return options.rootDirs;
|
|
1306
|
+
case 'skipLibCheck':
|
|
1307
|
+
return options.skipLibCheck;
|
|
1308
|
+
case 'stableTypeOrdering':
|
|
1309
|
+
return options.stableTypeOrdering;
|
|
1310
|
+
case 'strict':
|
|
1311
|
+
return options.strict;
|
|
1312
|
+
case 'strictBindCallApply':
|
|
1313
|
+
return options.strictBindCallApply;
|
|
1314
|
+
case 'strictBuiltinIteratorReturn':
|
|
1315
|
+
return options.strictBuiltinIteratorReturn;
|
|
1316
|
+
case 'strictFunctionTypes':
|
|
1317
|
+
return options.strictFunctionTypes;
|
|
1318
|
+
case 'strictNullChecks':
|
|
1319
|
+
return options.strictNullChecks;
|
|
1320
|
+
case 'strictPropertyInitialization':
|
|
1321
|
+
return options.strictPropertyInitialization;
|
|
1322
|
+
case 'stripInternal':
|
|
1323
|
+
return options.stripInternal;
|
|
1324
|
+
case 'skipDefaultLibCheck':
|
|
1325
|
+
return options.skipDefaultLibCheck;
|
|
1326
|
+
case 'sourceMap':
|
|
1327
|
+
return options.sourceMap;
|
|
1328
|
+
case 'sourceRoot':
|
|
1329
|
+
return options.sourceRoot;
|
|
1330
|
+
case 'suppressOutputPathCheck':
|
|
1331
|
+
return options.suppressOutputPathCheck;
|
|
1332
|
+
case 'target':
|
|
1333
|
+
return options.target;
|
|
1334
|
+
case 'traceResolution':
|
|
1335
|
+
return options.traceResolution;
|
|
1336
|
+
case 'tsBuildInfoFile':
|
|
1337
|
+
return options.tsBuildInfoFile;
|
|
1338
|
+
case 'typeRoots':
|
|
1339
|
+
return options.typeRoots;
|
|
1340
|
+
case 'types':
|
|
1341
|
+
return options.types;
|
|
1342
|
+
case 'useDefineForClassFields':
|
|
1343
|
+
return options.useDefineForClassFields;
|
|
1344
|
+
case 'useUnknownInCatchVariables':
|
|
1345
|
+
return options.useUnknownInCatchVariables;
|
|
1346
|
+
case 'verbatimModuleSyntax':
|
|
1347
|
+
return options.verbatimModuleSyntax;
|
|
1348
|
+
case 'maxNodeModuleJsDepth':
|
|
1349
|
+
return options.maxNodeModuleJsDepth;
|
|
1350
|
+
case 'allowSyntheticDefaultImports':
|
|
1351
|
+
return options.allowSyntheticDefaultImports;
|
|
1352
|
+
case 'alwaysStrict':
|
|
1353
|
+
return options.alwaysStrict;
|
|
1354
|
+
case 'baseUrl':
|
|
1355
|
+
return options.baseUrl;
|
|
1356
|
+
case 'downlevelIteration':
|
|
1357
|
+
return options.downlevelIteration;
|
|
1358
|
+
case 'esModuleInterop':
|
|
1359
|
+
return options.esModuleInterop;
|
|
1360
|
+
case 'outFile':
|
|
1361
|
+
return options.outFile;
|
|
1362
|
+
case 'configFilePath':
|
|
1363
|
+
return options.configFilePath;
|
|
1364
|
+
case 'noDtsResolution':
|
|
1365
|
+
return options.noDtsResolution;
|
|
1366
|
+
case 'pathsBasePath':
|
|
1367
|
+
return options.pathsBasePath;
|
|
1368
|
+
case 'diagnostics':
|
|
1369
|
+
return options.diagnostics;
|
|
1370
|
+
case 'extendedDiagnostics':
|
|
1371
|
+
return options.extendedDiagnostics;
|
|
1372
|
+
case 'generateCpuProfile':
|
|
1373
|
+
return options.generateCpuProfile;
|
|
1374
|
+
case 'generateTrace':
|
|
1375
|
+
return options.generateTrace;
|
|
1376
|
+
case 'listEmittedFiles':
|
|
1377
|
+
return options.listEmittedFiles;
|
|
1378
|
+
case 'listFiles':
|
|
1379
|
+
return options.listFiles;
|
|
1380
|
+
case 'explainFiles':
|
|
1381
|
+
return options.explainFiles;
|
|
1382
|
+
case 'listFilesOnly':
|
|
1383
|
+
return options.listFilesOnly;
|
|
1384
|
+
case 'noEmitForJsFiles':
|
|
1385
|
+
return options.noEmitForJsFiles;
|
|
1386
|
+
case 'preserveWatchOutput':
|
|
1387
|
+
return options.preserveWatchOutput;
|
|
1388
|
+
case 'pretty':
|
|
1389
|
+
return options.pretty;
|
|
1390
|
+
case 'version':
|
|
1391
|
+
return options.version;
|
|
1392
|
+
case 'watch':
|
|
1393
|
+
return options.watch;
|
|
1394
|
+
case 'showConfig':
|
|
1395
|
+
return options.showConfig;
|
|
1396
|
+
case 'build':
|
|
1397
|
+
return options.build;
|
|
1398
|
+
case 'help':
|
|
1399
|
+
return options.help;
|
|
1400
|
+
case 'all':
|
|
1401
|
+
return options.all;
|
|
1402
|
+
case 'pprofDir':
|
|
1403
|
+
return options.pprofDir;
|
|
1404
|
+
case 'singleThreaded':
|
|
1405
|
+
return options.singleThreaded;
|
|
1406
|
+
case 'quiet':
|
|
1407
|
+
return options.quiet;
|
|
1408
|
+
case 'checkers':
|
|
1409
|
+
return options.checkers;
|
|
1410
|
+
}
|
|
1411
|
+
return undefined;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
export function setWatchOption(options: WatchOptions, name: string, value: OptionValue): void {
|
|
1415
|
+
switch (name) {
|
|
1416
|
+
case 'watchInterval':
|
|
1417
|
+
options.watchInterval = numberValue(value);
|
|
1418
|
+
break;
|
|
1419
|
+
case 'watchFile':
|
|
1420
|
+
if (value !== null) options.watchFile = numberValue(value);
|
|
1421
|
+
break;
|
|
1422
|
+
case 'watchDirectory':
|
|
1423
|
+
if (value !== null) options.watchDirectory = numberValue(value);
|
|
1424
|
+
break;
|
|
1425
|
+
case 'fallbackPolling':
|
|
1426
|
+
if (value !== null) options.fallbackPolling = numberValue(value);
|
|
1427
|
+
break;
|
|
1428
|
+
case 'synchronousWatchDirectory':
|
|
1429
|
+
options.synchronousWatchDirectory = value === null ? undefined : value === true;
|
|
1430
|
+
break;
|
|
1431
|
+
case 'excludeDirectories':
|
|
1432
|
+
options.excludeDirectories = stringList(value);
|
|
1433
|
+
break;
|
|
1434
|
+
case 'excludeFiles':
|
|
1435
|
+
options.excludeFiles = stringList(value);
|
|
1436
|
+
break;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
export function setBuildOption(options: BuildOptions, name: string, value: OptionValue): void {
|
|
1441
|
+
if (value === null) return;
|
|
1442
|
+
switch (name) {
|
|
1443
|
+
case 'clean':
|
|
1444
|
+
options.clean = value === true;
|
|
1445
|
+
break;
|
|
1446
|
+
case 'dry':
|
|
1447
|
+
options.dry = value === true;
|
|
1448
|
+
break;
|
|
1449
|
+
case 'force':
|
|
1450
|
+
options.force = value === true;
|
|
1451
|
+
break;
|
|
1452
|
+
case 'builders':
|
|
1453
|
+
options.builders = numberValue(value);
|
|
1454
|
+
break;
|
|
1455
|
+
case 'stopBuildOnErrors':
|
|
1456
|
+
options.stopBuildOnErrors = value === true;
|
|
1457
|
+
break;
|
|
1458
|
+
case 'verbose':
|
|
1459
|
+
options.verbose = value === true;
|
|
1460
|
+
break;
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
export function setTypeAcquisitionOption(options: TypeAcquisition, name: string, value: OptionValue): void {
|
|
1465
|
+
if (value === null) return;
|
|
1466
|
+
switch (name) {
|
|
1467
|
+
case 'enable':
|
|
1468
|
+
options.enable = value === true;
|
|
1469
|
+
break;
|
|
1470
|
+
case 'include':
|
|
1471
|
+
options.include = stringList(value);
|
|
1472
|
+
break;
|
|
1473
|
+
case 'exclude':
|
|
1474
|
+
options.exclude = stringList(value);
|
|
1475
|
+
break;
|
|
1476
|
+
case 'disableFilenameBasedTypeAcquisition':
|
|
1477
|
+
options.disableFilenameBasedTypeAcquisition = value === true;
|
|
1478
|
+
break;
|
|
1479
|
+
}
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
// Effective values of options with computed defaults.
|
|
1483
|
+
|
|
1484
|
+
export function getEmitScriptTarget(options: CompilerOptions): ScriptTarget {
|
|
1485
|
+
return options.target ?? ScriptTarget.LatestStandard;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
export function getEmitModuleKind(options: CompilerOptions): ModuleKind {
|
|
1489
|
+
if (options.module !== undefined) return options.module;
|
|
1490
|
+
const target = getEmitScriptTarget(options);
|
|
1491
|
+
if (target === ScriptTarget.ESNext) return ModuleKind.ESNext;
|
|
1492
|
+
if (target >= ScriptTarget.ES2022) return ModuleKind.ES2022;
|
|
1493
|
+
if (target >= ScriptTarget.ES2020) return ModuleKind.ES2020;
|
|
1494
|
+
if (target >= ScriptTarget.ES2015) return ModuleKind.ES2015;
|
|
1495
|
+
return ModuleKind.CommonJS;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
export function getModuleResolutionKind(options: CompilerOptions): ModuleResolutionKind {
|
|
1499
|
+
const resolution = options.moduleResolution;
|
|
1500
|
+
if (
|
|
1501
|
+
resolution !== undefined &&
|
|
1502
|
+
resolution !== ModuleResolutionKind.Classic &&
|
|
1503
|
+
resolution !== ModuleResolutionKind.Node10
|
|
1504
|
+
) {
|
|
1505
|
+
return resolution;
|
|
1506
|
+
}
|
|
1507
|
+
switch (getEmitModuleKind(options)) {
|
|
1508
|
+
case ModuleKind.Node16:
|
|
1509
|
+
case ModuleKind.Node18:
|
|
1510
|
+
case ModuleKind.Node20:
|
|
1511
|
+
return ModuleResolutionKind.Node16;
|
|
1512
|
+
case ModuleKind.NodeNext:
|
|
1513
|
+
return ModuleResolutionKind.NodeNext;
|
|
1514
|
+
default:
|
|
1515
|
+
return ModuleResolutionKind.Bundler;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
export function getEmitModuleDetectionKind(options: CompilerOptions): ModuleDetectionKind {
|
|
1520
|
+
if (options.moduleDetection !== undefined) return options.moduleDetection;
|
|
1521
|
+
const module = getEmitModuleKind(options);
|
|
1522
|
+
return ModuleKind.Node16 <= module && module <= ModuleKind.NodeNext
|
|
1523
|
+
? ModuleDetectionKind.Force
|
|
1524
|
+
: ModuleDetectionKind.Auto;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
export function getResolvePackageJsonExports(options: CompilerOptions): boolean {
|
|
1528
|
+
return options.resolvePackageJsonExports !== false;
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
export function getResolvePackageJsonImports(options: CompilerOptions): boolean {
|
|
1532
|
+
return options.resolvePackageJsonImports !== false;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
export function getAllowImportingTsExtensions(options: CompilerOptions): boolean {
|
|
1536
|
+
return options.allowImportingTsExtensions === true || options.rewriteRelativeImportExtensions === true;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
export function getResolveJsonModule(options: CompilerOptions): boolean {
|
|
1540
|
+
if (options.resolveJsonModule !== undefined) return options.resolveJsonModule;
|
|
1541
|
+
const module = getEmitModuleKind(options);
|
|
1542
|
+
if (module === ModuleKind.Node20 || module === ModuleKind.NodeNext) return true;
|
|
1543
|
+
return getModuleResolutionKind(options) === ModuleResolutionKind.Bundler;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
export function getIsolatedModules(options: CompilerOptions): boolean {
|
|
1547
|
+
return options.isolatedModules === true || options.verbatimModuleSyntax === true;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
export function shouldPreserveConstEnums(options: CompilerOptions): boolean {
|
|
1551
|
+
return options.preserveConstEnums === true || getIsolatedModules(options);
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
export function getAllowJS(options: CompilerOptions): boolean {
|
|
1555
|
+
return options.allowJs ?? options.checkJs === true;
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
export function getStrictOptionValue(options: CompilerOptions, value: boolean | undefined): boolean {
|
|
1559
|
+
return value ?? options.strict !== false;
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
export function isIncremental(options: CompilerOptions): boolean {
|
|
1563
|
+
return options.incremental === true || options.composite === true;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
export function getUseDefineForClassFields(options: CompilerOptions): boolean {
|
|
1567
|
+
return options.useDefineForClassFields ?? getEmitScriptTarget(options) >= ScriptTarget.ES2022;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
export function getEmitDeclarations(options: CompilerOptions): boolean {
|
|
1571
|
+
return options.declaration === true || options.composite === true;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
export function getAreDeclarationMapsEnabled(options: CompilerOptions): boolean {
|
|
1575
|
+
return options.declarationMap === true && getEmitDeclarations(options);
|
|
1576
|
+
}
|