Skip to content

Commit 3cd8890

Browse files
Handle missing error when --incremental is used incorrectly (#2150)
Co-authored-by: Sheetal Nandi <[email protected]>
1 parent 345033c commit 3cd8890

18 files changed

+26
-8
lines changed

internal/compiler/program.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,10 @@ func (p *Program) verifyCompilerOptions() {
634634
}
635635
}
636636

637+
if options.TsBuildInfoFile == "" && options.Incremental.IsTrue() && options.ConfigFilePath == "" {
638+
createCompilerOptionsDiagnostic(diagnostics.Option_incremental_is_only_valid_with_a_known_configuration_file_like_tsconfig_json_or_when_tsBuildInfoFile_is_explicitly_provided)
639+
}
640+
637641
p.verifyProjectReferences()
638642

639643
if options.Composite.IsTrue() {

internal/diagnostics/diagnostics_generated.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/diagnostics/extraDiagnosticMessages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,9 @@
7070
"tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error.": {
7171
"category": "Error",
7272
"code": 5112
73+
},
74+
"Option '--incremental' is only valid with a known configuration file (like 'tsconfig.json') or when '--tsBuildInfoFile' is explicitly provided.": {
75+
"category": "Error",
76+
"code": 5074
7377
}
7478
}
-102 Bytes
Binary file not shown.
-91 Bytes
Binary file not shown.
-84 Bytes
Binary file not shown.
-81 Bytes
Binary file not shown.
-79 Bytes
Binary file not shown.
-91 Bytes
Binary file not shown.
-77 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)