Repository navigation
Expand file tree
/
Copy pathoptions.ts
More file actions
2488 lines (2483 loc) · 101 KB
/
Copy pathoptions.ts
File metadata and controls
2488 lines (2483 loc) · 101 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import preferenceSchema from "../../userPreferences.schema.json" with { type: "json" };
import {
type CompilerOptionType,
type Declaration,
diagnostic,
type OptionsModel,
} from "./options-model.ts";
export const formattingProperties = {
...preferenceSchema.$defs.EditorSettings.properties,
...preferenceSchema.$defs.FormatCodeSettings.properties,
};
export const formattingDeclarations: Declaration[] = Object.entries(formattingProperties).map(([name, property]) => ({
name,
kind: "enum" in property ? "Enum" : property.type === "boolean" ? "Boolean" : property.type === "integer" ? "Number" : "String",
...(property.type === "integer" ? { minValue: 0 } : {}),
}));
export const formattingFields = Object.entries(formattingProperties).map(([name, property]) => {
const field = name[0].toUpperCase() + name.slice(1);
const enumName = "Formatting" + ("x-go-type" in property ? property["x-go-type"] : field);
const enumType = "x-go-underlying" in property ? property["x-go-underlying"] : "string";
return {
name,
field,
type: property.type === "boolean" ? "Tristate" : "enum" in property ? `*${enumName}` : property.type === "integer" ? "*int" : "*string",
enumName,
enumType,
values: "enum" in property ? property.enum : undefined,
};
});
export const pluginImportFields: { name: string; type: CompilerOptionType; }[] = [
{ name: "name", type: "string" },
];
export const options: OptionsModel = {
schemaOnlyOptions: [
{
name: "charset",
type: "string",
description: "The text encoding used to read source files in early TypeScript versions.",
},
{
name: "out",
type: "string",
description: "The legacy predecessor of outFile, which combined emitted JavaScript into a single file.",
},
{
name: "noImplicitUseStrict",
type: "boolean",
description: "Disable adding 'use strict' directives to emitted JavaScript.",
},
{
name: "noStrictGenericChecks",
type: "boolean",
description: "Disable strict checking of generic signatures in function types.",
},
{
name: "keyofStringsOnly",
type: "boolean",
description: "Make keyof return only strings instead of strings, numbers, or symbols.",
},
{
name: "suppressExcessPropertyErrors",
type: "boolean",
description: "Disable excess property errors when creating object literals.",
},
{
name: "suppressImplicitAnyIndexErrors",
type: "boolean",
description: "Suppress noImplicitAny errors when indexing objects that lack index signatures.",
},
{
name: "preserveValueImports",
type: "boolean",
description: "Preserve unused imported values in JavaScript output. Superseded by verbatimModuleSyntax.",
},
{
name: "importsNotUsedAsValues",
type: "enum",
values: ["remove", "preserve", "error"],
description: "Control emit and checking for imports used only as types. Superseded by verbatimModuleSyntax.",
},
],
compilerOptions: [
{
name: "allowJs",
type: "Tristate",
jsconfigDefault: true,
declaration: {
group: "optionsForCompiler",
affectsBuildInfo: true,
showInSimplifiedHelpView: true,
category: diagnostic("JavaScript Support"),
description: diagnostic("Allow JavaScript files to be a part of your program. Use the 'checkJs' option to get errors from these files."),
defaultValueDescription: diagnostic("`false`, unless `checkJs` is set"),
},
},
{
name: "allowArbitraryExtensions",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Modules"),
description: diagnostic("Enable importing files with any extension, provided a declaration file is present."),
defaultValueDescription: false,
},
},
{
name: "allowImportingTsExtensions",
transpile: { value: "clear" },
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Modules"),
description: diagnostic("Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set."),
defaultValueDescription: false,
},
},
{
name: "allowNonTsExtensions",
transpile: { value: true },
type: "Tristate",
},
{
name: "allowUmdGlobalAccess",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Modules"),
description: diagnostic("Allow accessing UMD globals from modules."),
defaultValueDescription: false,
},
},
{
name: "allowUnreachableCode",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Type Checking"),
description: diagnostic("Disable error reporting for unreachable code."),
defaultValueDescription: { go: "core.TSUnknown" },
},
},
{
name: "allowUnusedLabels",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Type Checking"),
description: diagnostic("Disable error reporting for unused labels."),
defaultValueDescription: { go: "core.TSUnknown" },
},
},
{
name: "assumeChangesOnlyAffectDirectDependencies",
type: "Tristate",
declaration: {
group: "commonOptionsWithBuild",
affectsSemanticDiagnostics: true,
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Watch and Build Modes"),
description: diagnostic("Have recompiles in projects that use 'incremental' and 'watch' mode assume that changes within a file will only affect files directly depending on it."),
defaultValueDescription: false,
},
},
{
name: "checkJs",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
showInSimplifiedHelpView: true,
category: diagnostic("JavaScript Support"),
description: diagnostic("Enable error reporting in type-checked JavaScript files."),
defaultValueDescription: false,
},
},
{
name: "customConditions",
type: "[]string",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Modules"),
description: diagnostic("Conditions to set in addition to the resolver-specific defaults when resolving imports."),
},
},
{
name: "composite",
transpile: { value: "clear" },
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsBuildInfo: true,
isTSConfigOnly: true,
category: diagnostic("Projects"),
defaultValueDescription: false,
description: diagnostic("Enable constraints that allow a TypeScript project to be used with project references."),
},
},
{
name: "emitDeclarationOnly",
transpile: { value: "clear", declarationValue: true },
type: "Tristate",
declaration: {
group: "commonOptionsWithBuild",
// Full emit is calculated separately, so this does not set affectsEmit.
affectsBuildInfo: true,
showInSimplifiedHelpView: true,
category: diagnostic("Emit"),
description: diagnostic("Only output d.ts files and not JavaScript files."),
defaultValueDescription: false,
},
},
{
name: "emitBOM",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Emit"),
description: diagnostic("Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files."),
defaultValueDescription: false,
},
},
{
name: "emitDecoratorMetadata",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Language and Environment"),
description: diagnostic("Emit design-type metadata for decorated declarations in source files."),
defaultValueDescription: false,
},
},
{
name: "declaration",
transpile: { value: false, declarationValue: true },
type: "Tristate",
declaration: {
group: "commonOptionsWithBuild",
// Full emit is calculated separately, so this does not set affectsEmit.
shortName: "d",
affectsBuildInfo: true,
showInSimplifiedHelpView: true,
category: diagnostic("Emit"),
description: diagnostic("Generate .d.ts files from TypeScript and JavaScript files in your project."),
defaultValueDescription: diagnostic("`false`, unless `composite` is set"),
},
},
{
name: "declarationDir",
transpile: { value: "clear" },
type: "string",
pathKind: "directory",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
affectsDeclarationPath: true,
isFilePath: true,
category: diagnostic("Emit"),
description: diagnostic("Specify the output directory for generated declaration files."),
},
},
{
name: "declarationMap",
transpile: { value: false, declarationValue: "preserve" },
type: "Tristate",
declaration: {
group: "commonOptionsWithBuild",
// Full emit is calculated separately, so this does not set affectsEmit.
affectsBuildInfo: true,
showInSimplifiedHelpView: true,
category: diagnostic("Emit"),
defaultValueDescription: false,
description: diagnostic("Create sourcemaps for d.ts files."),
},
},
{
name: "deduplicatePackages",
type: "Tristate",
declaration: {
group: "commonOptionsWithBuild",
category: diagnostic("Type Checking"),
description: diagnostic("Deduplicate packages with the same name and version."),
documentationAnchor: false,
defaultValueDescription: true,
},
},
{
name: "disableSizeLimit",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Editor Support"),
description: diagnostic("Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server."),
defaultValueDescription: false,
},
},
{
name: "disableSourceOfProjectReferenceRedirect",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
isTSConfigOnly: true,
category: diagnostic("Projects"),
description: diagnostic("Disable preferring source files instead of declaration files when referencing composite projects."),
defaultValueDescription: false,
},
},
{
name: "disableSolutionSearching",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
isTSConfigOnly: true,
category: diagnostic("Projects"),
description: diagnostic("Opt a project out of multi-project reference checking when editing."),
defaultValueDescription: false,
},
},
{
name: "disableReferencedProjectLoad",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
isTSConfigOnly: true,
category: diagnostic("Projects"),
description: diagnostic("Reduce the number of projects loaded automatically by TypeScript."),
defaultValueDescription: false,
},
},
{
name: "erasableSyntaxOnly",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Interop Constraints"),
description: diagnostic("Do not allow runtime constructs that are not part of ECMAScript."),
defaultValueDescription: false,
affectsBuildInfo: true,
affectsSemanticDiagnostics: true,
},
},
{
name: "exactOptionalPropertyTypes",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Type Checking"),
description: diagnostic("Interpret optional property types as written, rather than adding 'undefined'."),
defaultValueDescription: false,
},
},
{
name: "experimentalDecorators",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Language and Environment"),
description: diagnostic("Enable experimental support for legacy experimental decorators."),
defaultValueDescription: false,
},
},
{
name: "forceConsistentCasingInFileNames",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Interop Constraints"),
description: diagnostic("Ensure that casing is correct in imports."),
defaultValueDescription: true,
},
},
{
name: "isolatedModules",
transpile: { value: true, unless: "verbatimModuleSyntax" },
type: "Tristate",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Interop Constraints"),
description: diagnostic("Ensure that each file can be safely transpiled without relying on other imports."),
defaultValueDescription: false,
},
},
{
name: "isolatedDeclarations",
transpile: { value: false, declarationValue: true },
type: "Tristate",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Interop Constraints"),
description: diagnostic("Require sufficient annotation on exports so other tools can trivially generate declaration files."),
defaultValueDescription: false,
affectsBuildInfo: true,
affectsSemanticDiagnostics: true,
},
},
{
name: "ignoreConfig",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
showInSimplifiedHelpView: true,
category: diagnostic("Command-line Options"),
isCommandLineOnly: true,
description: diagnostic("Ignore the tsconfig found and build with commandline options and files."),
defaultValueDescription: false,
},
},
{
name: "ignoreDeprecations",
type: "string",
declaration: {
group: "optionsForCompiler",
defaultValueDescription: { go: "core.TSUnknown" },
},
},
{
name: "importHelpers",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Emit"),
description: diagnostic("Allow importing helper functions from tslib once per project, instead of including them per-file."),
defaultValueDescription: false,
},
},
{
name: "inlineSourceMap",
type: "Tristate",
declaration: {
group: "commonOptionsWithBuild",
// Full emit is calculated separately, so this does not set affectsEmit.
affectsBuildInfo: true,
category: diagnostic("Emit"),
description: diagnostic("Include sourcemap files inside the emitted JavaScript."),
defaultValueDescription: false,
},
},
{
name: "inlineSources",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Emit"),
description: diagnostic("Include source code in the sourcemaps inside the emitted JavaScript."),
defaultValueDescription: false,
},
},
{
name: "init",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
showInSimplifiedHelpView: true,
category: diagnostic("Command-line Options"),
description: diagnostic("Initializes a TypeScript project and creates a tsconfig.json file."),
defaultValueDescription: false,
},
},
{
name: "incremental",
transpile: { value: "clear" },
type: "Tristate",
declaration: {
group: "commonOptionsWithBuild",
shortName: "i",
category: diagnostic("Projects"),
description: diagnostic("Save .tsbuildinfo files to allow for incremental compilation of projects."),
defaultValueDescription: diagnostic("`false`, unless `composite` is set"),
},
},
{
name: "jsx",
type: "JsxEmit",
declaration: {
group: "optionsForCompiler",
// JSX without this option is a semantic error; changing it must refresh semantic diagnostics.
affectsEmit: true,
affectsBuildInfo: true,
affectsSemanticDiagnostics: true,
showInSimplifiedHelpView: true,
category: diagnostic("Language and Environment"),
description: diagnostic("Specify what JSX code is generated."),
defaultValueDescription: { go: "core.TSUnknown" },
},
},
{
name: "jsxFactory",
type: "string",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Language and Environment"),
description: diagnostic("Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'."),
defaultValueDescription: "`React.createElement`",
},
},
{
name: "jsxFragmentFactory",
type: "string",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Language and Environment"),
description: diagnostic("Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'."),
defaultValueDescription: "React.Fragment",
},
},
{
name: "jsxImportSource",
type: "string",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Language and Environment"),
description: diagnostic("Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'."),
defaultValueDescription: "react",
},
},
{
name: "lib",
transpile: { value: "clear" },
type: "[]string",
declaration: {
group: "optionsForCompiler",
showInSimplifiedHelpView: true,
category: diagnostic("Language and Environment"),
description: diagnostic("Specify a set of bundled library declaration files that describe the target runtime environment."),
},
},
{
name: "libReplacement",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Language and Environment"),
description: diagnostic("Enable lib replacement."),
defaultValueDescription: false,
},
},
{
name: "locale",
type: "string",
declaration: {
group: "commonOptionsWithBuild",
category: diagnostic("Command-line Options"),
isCommandLineOnly: true,
description: diagnostic("Set the language of the messaging from TypeScript. This does not affect emit."),
defaultValueDescription: diagnostic("Platform specific"),
extraValidation: "locale",
},
},
{
name: "mapRoot",
type: "string",
pathKind: "sourceMapLocation",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Emit"),
description: diagnostic("Specify the location where debugger should locate map files instead of generated locations."),
},
},
{
name: "module",
type: "ModuleKind",
declaration: {
group: "optionsForCompiler",
shortName: "m",
affectsEmit: true,
affectsBuildInfo: true,
showInSimplifiedHelpView: true,
category: diagnostic("Modules"),
description: diagnostic("Specify what module code is generated."),
defaultValueDescription: { go: "core.TSUnknown" },
},
},
{
name: "moduleResolution",
type: "ModuleResolutionKind",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Modules"),
description: diagnostic("Specify how TypeScript looks up a file from a given module specifier."),
defaultValueDescription: diagnostic("`nodenext` if `module` is `nodenext`; `node16` if `module` is `node16` or `node18`; otherwise, `bundler`."),
},
},
{
name: "moduleSuffixes",
type: "[]string",
declaration: {
group: "optionsForCompiler",
listPreserveFalsyValues: true,
category: diagnostic("Modules"),
description: diagnostic("List of file name suffixes to search when resolving a module."),
},
},
{
name: "moduleDetection",
type: "ModuleDetectionKind",
parseAliases: [
"moduleDetectionKind",
],
declaration: {
group: "optionsForCompiler",
description: diagnostic("Control what method is used to detect module-format JS files."),
category: diagnostic("Language and Environment"),
defaultValueDescription: diagnostic('"auto": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules.'),
},
},
{
name: "newLine",
type: "NewLineKind",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Emit"),
description: diagnostic("Set the newline character for emitting files."),
defaultValueDescription: "lf",
},
},
{
name: "noEmit",
transpile: { value: "clear" },
type: "Tristate",
jsconfigDefault: true,
declaration: {
group: "commonOptionsWithBuild",
showInSimplifiedHelpView: true,
category: diagnostic("Emit"),
description: diagnostic("Disable emitting files from a compilation."),
defaultValueDescription: false,
},
},
{
name: "noCheck",
transpile: { value: true },
type: "Tristate",
declaration: {
group: "commonOptionsWithBuild",
// The builder handles this specially so changing noCheck does not discard all diagnostics.
showInSimplifiedHelpView: false,
category: diagnostic("Compiler Diagnostics"),
description: diagnostic("Disable full type checking (only critical parse and emit errors will be reported)."),
defaultValueDescription: false,
},
},
{
name: "noErrorTruncation",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Output Formatting"),
description: diagnostic("Disable truncating types in error messages."),
defaultValueDescription: false,
},
},
{
name: "noFallthroughCasesInSwitch",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Type Checking"),
description: diagnostic("Enable error reporting for fallthrough cases in switch statements."),
defaultValueDescription: false,
},
},
{
name: "noImplicitAny",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
strictFlag: true,
category: diagnostic("Type Checking"),
description: diagnostic("Enable error reporting for expressions and declarations with an implied 'any' type."),
defaultValueDescription: diagnostic("`true`, unless `strict` is `false`"),
},
},
{
name: "noImplicitThis",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
strictFlag: true,
category: diagnostic("Type Checking"),
description: diagnostic("Enable error reporting when 'this' is given the type 'any'."),
defaultValueDescription: diagnostic("`true`, unless `strict` is `false`"),
},
},
{
name: "noImplicitReturns",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Type Checking"),
description: diagnostic("Enable error reporting for codepaths that do not explicitly return in a function."),
defaultValueDescription: false,
},
},
{
name: "noEmitHelpers",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Emit"),
description: diagnostic("Disable generating custom helper functions like '__extends' in compiled output."),
defaultValueDescription: false,
},
},
{
name: "noLib",
transpile: { value: true, declarationValue: false },
type: "Tristate",
declaration: {
group: "optionsForCompiler",
// Transpilation does not supply library source files, so noLib avoids reporting missing files.
category: diagnostic("Language and Environment"),
description: diagnostic("Disable including any library files, including the default lib.d.ts."),
defaultValueDescription: false,
},
},
{
name: "noPropertyAccessFromIndexSignature",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
showInSimplifiedHelpView: false,
category: diagnostic("Type Checking"),
description: diagnostic("Enforces using indexed accessors for keys declared using an indexed type."),
defaultValueDescription: false,
},
},
{
name: "noUncheckedIndexedAccess",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Type Checking"),
description: diagnostic("Add 'undefined' to a type when accessed using an index."),
defaultValueDescription: false,
},
},
{
name: "noEmitOnError",
transpile: { value: "clear" },
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Emit"),
description: diagnostic("Disable emitting files if any type checking errors are reported."),
defaultValueDescription: false,
},
},
{
name: "noUnusedLocals",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Type Checking"),
description: diagnostic("Enable error reporting when local variables aren't read."),
defaultValueDescription: false,
},
},
{
name: "noUnusedParameters",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Type Checking"),
description: diagnostic("Raise an error when a function parameter isn't read."),
defaultValueDescription: false,
},
},
{
name: "noResolve",
transpile: { value: true },
type: "Tristate",
declaration: {
group: "optionsForCompiler",
// Transpilation does not resolve the full program, so noResolve avoids reporting missing files.
category: diagnostic("Modules"),
description: diagnostic("Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project."),
defaultValueDescription: false,
},
},
{
name: "noImplicitOverride",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Type Checking"),
description: diagnostic("Ensure overriding members in derived classes are marked with an override modifier."),
defaultValueDescription: false,
},
},
{
name: "noUncheckedSideEffectImports",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Modules"),
description: diagnostic("Check side effect imports."),
defaultValueDescription: true,
},
},
{
name: "outDir",
type: "string",
pathKind: "directory",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
affectsDeclarationPath: true,
isFilePath: true,
showInSimplifiedHelpView: true,
category: diagnostic("Emit"),
description: diagnostic("Specify an output folder for all emitted files."),
},
},
{
name: "paths",
transpile: { value: "clear" },
type: "*collections.OrderedMap[string, []string]",
declaration: {
group: "optionsForCompiler",
allowConfigDirTemplateSubstitution: true,
isTSConfigOnly: true,
category: diagnostic("Modules"),
description: diagnostic("Specify a set of entries that re-map imports to additional lookup locations."),
},
},
{
name: "plugins",
type: "[]PluginImport",
comment: "Plugins are parsed only so tools can report that native TypeScript does not support them.",
declaration: {
group: "optionsForCompiler",
isTSConfigOnly: true,
description: diagnostic("Specify a list of language service plugins to include."),
category: diagnostic("Editor Support"),
},
},
{
name: "preserveConstEnums",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Emit"),
description: diagnostic("Disable erasing 'const enum' declarations in generated code."),
defaultValueDescription: false,
},
},
{
name: "preserveSymlinks",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Interop Constraints"),
description: diagnostic("Disable resolving symlinks to their realpath. This correlates to the same flag in node."),
defaultValueDescription: false,
},
},
{
name: "project",
type: "string",
pathKind: "fileOrDirectory",
declaration: {
group: "optionsForCompiler",
shortName: "p",
isFilePath: true,
allowConfigDirTemplateSubstitution: false,
showInSimplifiedHelpView: true,
category: diagnostic("Command-line Options"),
description: diagnostic("Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'."),
},
},
{
name: "resolveJsonModule",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Modules"),
description: diagnostic("Enable importing .json files."),
defaultValueDescription: false,
},
},
{
name: "resolvePackageJsonExports",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Modules"),
description: diagnostic("Use the package.json 'exports' field when resolving package imports."),
defaultValueDescription: diagnostic("`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."),
},
},
{
name: "resolvePackageJsonImports",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
category: diagnostic("Modules"),
description: diagnostic("Use the package.json 'imports' field when resolving imports."),
defaultValueDescription: diagnostic("`true` when 'moduleResolution' is 'node16', 'nodenext', or 'bundler'; otherwise `false`."),
},
},
{
name: "removeComments",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
showInSimplifiedHelpView: true,
category: diagnostic("Emit"),
defaultValueDescription: false,
description: diagnostic("Disable emitting comments."),
},
},
{
name: "rewriteRelativeImportExtensions",
type: "Tristate",
declaration: {
group: "optionsForCompiler",
affectsSemanticDiagnostics: true,
affectsBuildInfo: true,
category: diagnostic("Modules"),
description: diagnostic("Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files."),
defaultValueDescription: false,
},
},
{
name: "reactNamespace",
type: "string",
declaration: {
group: "optionsForCompiler",
affectsEmit: true,
affectsBuildInfo: true,
category: diagnostic("Language and Environment"),
description: diagnostic("Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit."),
defaultValueDescription: "`React`",