diff --git a/internal/compiler/program.go b/internal/compiler/program.go index f25efc404d..aec50f15e3 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -634,6 +634,10 @@ func (p *Program) verifyCompilerOptions() { } } + if options.TsBuildInfoFile == "" && options.Incremental.IsTrue() && options.ConfigFilePath == "" { + createCompilerOptionsDiagnostic(diagnostics.Option_incremental_is_only_valid_with_a_known_configuration_file_like_tsconfig_json_or_when_tsBuildInfoFile_is_explicitly_provided) + } + p.verifyProjectReferences() if options.Composite.IsTrue() { diff --git a/internal/diagnostics/diagnostics_generated.go b/internal/diagnostics/diagnostics_generated.go index d59fa2ec20..f79fb06e0a 100644 --- a/internal/diagnostics/diagnostics_generated.go +++ b/internal/diagnostics/diagnostics_generated.go @@ -2288,7 +2288,7 @@ var Unknown_build_option_0 = &Message{code: 5072, category: CategoryError, key: var Build_option_0_requires_a_value_of_type_1 = &Message{code: 5073, category: CategoryError, key: "Build_option_0_requires_a_value_of_type_1_5073", text: "Build option '{0}' requires a value of type {1}."} -var Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified = &Message{code: 5074, category: CategoryError, key: "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074", text: "Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified."} +var Option_incremental_is_only_valid_with_a_known_configuration_file_like_tsconfig_json_or_when_tsBuildInfoFile_is_explicitly_provided = &Message{code: 5074, category: CategoryError, key: "Option_incremental_is_only_valid_with_a_known_configuration_file_like_tsconfig_json_or_when_tsBuildI_5074", text: "Option '--incremental' is only valid with a known configuration file (like 'tsconfig.json') or when '--tsBuildInfoFile' is explicitly provided."} var X_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2 = &Message{code: 5075, category: CategoryError, key: "_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075", text: "'{0}' is assignable to the constraint of type '{1}', but '{1}' could be instantiated with a different subtype of constraint '{2}'."} @@ -6550,8 +6550,8 @@ func keyToMessage(key Key) *Message { return Unknown_build_option_0 case "Build_option_0_requires_a_value_of_type_1_5073": return Build_option_0_requires_a_value_of_type_1 - case "Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBui_5074": - return Option_incremental_can_only_be_specified_using_tsconfig_emitting_to_single_file_or_when_option_tsBuildInfoFile_is_specified + case "Option_incremental_is_only_valid_with_a_known_configuration_file_like_tsconfig_json_or_when_tsBuildI_5074": + return Option_incremental_is_only_valid_with_a_known_configuration_file_like_tsconfig_json_or_when_tsBuildInfoFile_is_explicitly_provided case "_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_5075": return X_0_is_assignable_to_the_constraint_of_type_1_but_1_could_be_instantiated_with_a_different_subtype_of_constraint_2 case "_0_and_1_operations_cannot_be_mixed_without_parentheses_5076": diff --git a/internal/diagnostics/extraDiagnosticMessages.json b/internal/diagnostics/extraDiagnosticMessages.json index 47d3e93a11..8269c32d68 100644 --- a/internal/diagnostics/extraDiagnosticMessages.json +++ b/internal/diagnostics/extraDiagnosticMessages.json @@ -54,5 +54,9 @@ "tsconfig.json is present but will not be loaded if files are specified on commandline. Use '--ignoreConfig' to skip this error.": { "category": "Error", "code": 5112 + }, + "Option '--incremental' is only valid with a known configuration file (like 'tsconfig.json') or when '--tsBuildInfoFile' is explicitly provided.": { + "category": "Error", + "code": 5074 } } diff --git a/internal/diagnostics/loc/cs-CZ.json.gz b/internal/diagnostics/loc/cs-CZ.json.gz index df21c307f0..93ec67c5f9 100644 Binary files a/internal/diagnostics/loc/cs-CZ.json.gz and b/internal/diagnostics/loc/cs-CZ.json.gz differ diff --git a/internal/diagnostics/loc/de-DE.json.gz b/internal/diagnostics/loc/de-DE.json.gz index 5b398845ea..ed29ca8858 100644 Binary files a/internal/diagnostics/loc/de-DE.json.gz and b/internal/diagnostics/loc/de-DE.json.gz differ diff --git a/internal/diagnostics/loc/es-ES.json.gz b/internal/diagnostics/loc/es-ES.json.gz index d068162ce1..15baec0e09 100644 Binary files a/internal/diagnostics/loc/es-ES.json.gz and b/internal/diagnostics/loc/es-ES.json.gz differ diff --git a/internal/diagnostics/loc/fr-FR.json.gz b/internal/diagnostics/loc/fr-FR.json.gz index ac9536dbef..d5533cba73 100644 Binary files a/internal/diagnostics/loc/fr-FR.json.gz and b/internal/diagnostics/loc/fr-FR.json.gz differ diff --git a/internal/diagnostics/loc/it-IT.json.gz b/internal/diagnostics/loc/it-IT.json.gz index 31328e9ee4..634120a012 100644 Binary files a/internal/diagnostics/loc/it-IT.json.gz and b/internal/diagnostics/loc/it-IT.json.gz differ diff --git a/internal/diagnostics/loc/ja-JP.json.gz b/internal/diagnostics/loc/ja-JP.json.gz index 035a86ccce..5a61805411 100644 Binary files a/internal/diagnostics/loc/ja-JP.json.gz and b/internal/diagnostics/loc/ja-JP.json.gz differ diff --git a/internal/diagnostics/loc/ko-KR.json.gz b/internal/diagnostics/loc/ko-KR.json.gz index 05a48d3142..37a06dc75b 100644 Binary files a/internal/diagnostics/loc/ko-KR.json.gz and b/internal/diagnostics/loc/ko-KR.json.gz differ diff --git a/internal/diagnostics/loc/pl-PL.json.gz b/internal/diagnostics/loc/pl-PL.json.gz index 33a6f2812b..2a3e091b80 100644 Binary files a/internal/diagnostics/loc/pl-PL.json.gz and b/internal/diagnostics/loc/pl-PL.json.gz differ diff --git a/internal/diagnostics/loc/pt-BR.json.gz b/internal/diagnostics/loc/pt-BR.json.gz index 2b8064be3e..3ed87af153 100644 Binary files a/internal/diagnostics/loc/pt-BR.json.gz and b/internal/diagnostics/loc/pt-BR.json.gz differ diff --git a/internal/diagnostics/loc/ru-RU.json.gz b/internal/diagnostics/loc/ru-RU.json.gz index 0c31506b61..68648dc0eb 100644 Binary files a/internal/diagnostics/loc/ru-RU.json.gz and b/internal/diagnostics/loc/ru-RU.json.gz differ diff --git a/internal/diagnostics/loc/tr-TR.json.gz b/internal/diagnostics/loc/tr-TR.json.gz index 4ef9c4594f..246d34f0cb 100644 Binary files a/internal/diagnostics/loc/tr-TR.json.gz and b/internal/diagnostics/loc/tr-TR.json.gz differ diff --git a/internal/diagnostics/loc/zh-CN.json.gz b/internal/diagnostics/loc/zh-CN.json.gz index 9498a59ae0..49fc97fc5e 100644 Binary files a/internal/diagnostics/loc/zh-CN.json.gz and b/internal/diagnostics/loc/zh-CN.json.gz differ diff --git a/internal/diagnostics/loc/zh-TW.json.gz b/internal/diagnostics/loc/zh-TW.json.gz index d95f48c53a..1b5d5e6ce6 100644 Binary files a/internal/diagnostics/loc/zh-TW.json.gz and b/internal/diagnostics/loc/zh-TW.json.gz differ diff --git a/testdata/baselines/reference/submodule/compiler/incrementalInvalid.errors.txt b/testdata/baselines/reference/submodule/compiler/incrementalInvalid.errors.txt new file mode 100644 index 0000000000..29b9039f30 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/incrementalInvalid.errors.txt @@ -0,0 +1,8 @@ +error TS5074: Option '--incremental' is only valid with a known configuration file (like 'tsconfig.json') or when '--tsBuildInfoFile' is explicitly provided. + + +!!! error TS5074: Option '--incremental' is only valid with a known configuration file (like 'tsconfig.json') or when '--tsBuildInfoFile' is explicitly provided. +==== incrementalInvalid.ts (0 errors) ==== + const x = 10; + + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/incrementalInvalid.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/incrementalInvalid.errors.txt.diff index 0e9d82e834..ff26767edf 100644 --- a/testdata/baselines/reference/submodule/compiler/incrementalInvalid.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/incrementalInvalid.errors.txt.diff @@ -5,8 +5,10 @@ - - -!!! error TS5074: Option '--incremental' can only be specified using tsconfig, emitting to single file or when option '--tsBuildInfoFile' is specified. --==== incrementalInvalid.ts (0 errors) ==== -- const x = 10; -- -- -+ \ No newline at end of file ++error TS5074: Option '--incremental' is only valid with a known configuration file (like 'tsconfig.json') or when '--tsBuildInfoFile' is explicitly provided. ++ ++ ++!!! error TS5074: Option '--incremental' is only valid with a known configuration file (like 'tsconfig.json') or when '--tsBuildInfoFile' is explicitly provided. + ==== incrementalInvalid.ts (0 errors) ==== + const x = 10; + \ No newline at end of file