typescript 5.0.1-rc → 5.0.3

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.
@@ -19,4 +19,4 @@ and limitations under the License.
19
19
  declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
20
20
  declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
21
21
  declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
22
- declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;
22
+ declare type ParameterDecorator = (target: Object, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
package/lib/tsc.js CHANGED
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.1-rc`;
26
+ var version = "5.0.3";
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -3854,6 +3854,7 @@ function diagnosticCategoryName(d, lowerCase = true) {
3854
3854
  }
3855
3855
  var ModuleResolutionKind = /* @__PURE__ */ ((ModuleResolutionKind2) => {
3856
3856
  ModuleResolutionKind2[ModuleResolutionKind2["Classic"] = 1] = "Classic";
3857
+ ModuleResolutionKind2[ModuleResolutionKind2["NodeJs"] = 2] = "NodeJs";
3857
3858
  ModuleResolutionKind2[ModuleResolutionKind2["Node10"] = 2] = "Node10";
3858
3859
  ModuleResolutionKind2[ModuleResolutionKind2["Node16"] = 3] = "Node16";
3859
3860
  ModuleResolutionKind2[ModuleResolutionKind2["NodeNext"] = 99] = "NodeNext";
@@ -4914,20 +4915,6 @@ function patchWriteFileEnsuringDirectory(sys2) {
4914
4915
  (path2) => sys2.directoryExists(path2)
4915
4916
  );
4916
4917
  }
4917
- function getNodeMajorVersion() {
4918
- if (typeof process === "undefined") {
4919
- return void 0;
4920
- }
4921
- const version2 = process.version;
4922
- if (!version2) {
4923
- return void 0;
4924
- }
4925
- const dot = version2.indexOf(".");
4926
- if (dot === -1) {
4927
- return void 0;
4928
- }
4929
- return parseInt(version2.substring(1, dot));
4930
- }
4931
4918
  var sys = (() => {
4932
4919
  const byteOrderMarkIndicator = "\uFEFF";
4933
4920
  function getNodeSystem() {
@@ -4944,14 +4931,12 @@ var sys = (() => {
4944
4931
  let activeSession;
4945
4932
  let profilePath = "./profile.cpuprofile";
4946
4933
  const Buffer2 = require("buffer").Buffer;
4947
- const nodeVersion = getNodeMajorVersion();
4948
- const isNode4OrLater = nodeVersion >= 4;
4949
4934
  const isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
4950
4935
  const platform = _os.platform();
4951
4936
  const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
4952
4937
  const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
4953
4938
  const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
4954
- const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
4939
+ const fsSupportsRecursiveFsWatch = process.platform === "win32" || process.platform === "darwin";
4955
4940
  const getCurrentDirectory = memoize(() => process.cwd());
4956
4941
  const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
4957
4942
  pollingWatchFileWorker: fsWatchFileWorker,
@@ -6894,12 +6879,14 @@ var Diagnostics = {
6894
6879
  Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set: diag(5096, 1 /* Error */, "Option_allowImportingTsExtensions_can_only_be_used_when_either_noEmit_or_emitDeclarationOnly_is_set_5096", "Option 'allowImportingTsExtensions' can only be used when either 'noEmit' or 'emitDeclarationOnly' is set."),
6895
6880
  An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled: diag(5097, 1 /* Error */, "An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled_5097", "An import path can only end with a '{0}' extension when 'allowImportingTsExtensions' is enabled."),
6896
6881
  Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler: diag(5098, 1 /* Error */, "Option_0_can_only_be_used_when_moduleResolution_is_set_to_node16_nodenext_or_bundler_5098", "Option '{0}' can only be used when 'moduleResolution' is set to 'node16', 'nodenext', or 'bundler'."),
6897
- Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecat_5101", `Flag '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`),
6898
- Flag_0_is_deprecated_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Flag_0_is_deprecated_Please_remove_it_from_your_configuration_5102", "Flag '{0}' is deprecated. Please remove it from your configuration."),
6882
+ Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error: diag(5101, 1 /* Error */, "Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprec_5101", `Option '{0}' is deprecated and will stop functioning in TypeScript {1}. Specify compilerOption '"ignoreDeprecations": "{2}"' to silence this error.`),
6883
+ Option_0_has_been_removed_Please_remove_it_from_your_configuration: diag(5102, 1 /* Error */, "Option_0_has_been_removed_Please_remove_it_from_your_configuration_5102", "Option '{0}' has been removed. Please remove it from your configuration."),
6899
6884
  Invalid_value_for_ignoreDeprecations: diag(5103, 1 /* Error */, "Invalid_value_for_ignoreDeprecations_5103", "Invalid value for '--ignoreDeprecations'."),
6900
6885
  Option_0_is_redundant_and_cannot_be_specified_with_option_1: diag(5104, 1 /* Error */, "Option_0_is_redundant_and_cannot_be_specified_with_option_1_5104", "Option '{0}' is redundant and cannot be specified with option '{1}'."),
6901
6886
  Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System: diag(5105, 1 /* Error */, "Option_verbatimModuleSyntax_cannot_be_used_when_module_is_set_to_UMD_AMD_or_System_5105", "Option 'verbatimModuleSyntax' cannot be used when 'module' is set to 'UMD', 'AMD', or 'System'."),
6902
6887
  Use_0_instead: diag(5106, 3 /* Message */, "Use_0_instead_5106", "Use '{0}' instead."),
6888
+ Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error: diag(5107, 1 /* Error */, "Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDepr_5107", `Option '{0}={1}' is deprecated and will stop functioning in TypeScript {2}. Specify compilerOption '"ignoreDeprecations": "{3}"' to silence this error.`),
6889
+ Option_0_1_has_been_removed_Please_remove_it_from_your_configuration: diag(5108, 1 /* Error */, "Option_0_1_has_been_removed_Please_remove_it_from_your_configuration_5108", "Option '{0}={1}' has been removed. Please remove it from your configuration."),
6903
6890
  Generates_a_sourcemap_for_each_corresponding_d_ts_file: diag(6e3, 3 /* Message */, "Generates_a_sourcemap_for_each_corresponding_d_ts_file_6000", "Generates a sourcemap for each corresponding '.d.ts' file."),
6904
6891
  Concatenate_and_emit_output_to_single_file: diag(6001, 3 /* Message */, "Concatenate_and_emit_output_to_single_file_6001", "Concatenate and emit output to single file."),
6905
6892
  Generates_corresponding_d_ts_file: diag(6002, 3 /* Message */, "Generates_corresponding_d_ts_file_6002", "Generates corresponding '.d.ts' file."),
@@ -37437,7 +37424,7 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
37437
37424
  }
37438
37425
  function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
37439
37426
  return nodeModuleNameResolverWorker(
37440
- 8 /* Exports */,
37427
+ 30 /* NodeNextDefault */,
37441
37428
  moduleName,
37442
37429
  getDirectoryPath(containingFile),
37443
37430
  { moduleResolution: 99 /* NodeNext */ },
@@ -53142,9 +53129,10 @@ function createTypeChecker(host) {
53142
53129
  setStructuredTypeMembers(type, emptySymbols, emptyArray, emptyArray, emptyArray);
53143
53130
  const typeParameter = getTypeParameterFromMappedType(type);
53144
53131
  const constraintType = getConstraintTypeFromMappedType(type);
53145
- const nameType = getNameTypeFromMappedType(type.target || type);
53146
- const isFilteringMappedType = nameType && isTypeAssignableTo(nameType, typeParameter);
53147
- const templateType = getTemplateTypeFromMappedType(type.target || type);
53132
+ const mappedType = type.target || type;
53133
+ const nameType = getNameTypeFromMappedType(mappedType);
53134
+ const shouldLinkPropDeclarations = !nameType || isFilteringMappedType(mappedType);
53135
+ const templateType = getTemplateTypeFromMappedType(mappedType);
53148
53136
  const modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
53149
53137
  const templateModifiers = getMappedTypeModifiers(type);
53150
53138
  const include = keyofStringsOnly ? 128 /* StringLiteral */ : 8576 /* StringOrNumberLiteralOrUnique */;
@@ -53181,7 +53169,7 @@ function createTypeChecker(host) {
53181
53169
  prop.links.keyType = keyType;
53182
53170
  if (modifiersProp) {
53183
53171
  prop.links.syntheticOrigin = modifiersProp;
53184
- prop.declarations = !nameType || isFilteringMappedType ? modifiersProp.declarations : void 0;
53172
+ prop.declarations = shouldLinkPropDeclarations ? modifiersProp.declarations : void 0;
53185
53173
  }
53186
53174
  members.set(propName, prop);
53187
53175
  }
@@ -53287,6 +53275,10 @@ function createTypeChecker(host) {
53287
53275
  }
53288
53276
  return false;
53289
53277
  }
53278
+ function isFilteringMappedType(type) {
53279
+ const nameType = getNameTypeFromMappedType(type);
53280
+ return !!nameType && isTypeAssignableTo(nameType, getTypeParameterFromMappedType(type));
53281
+ }
53290
53282
  function resolveStructuredTypeMembers(type) {
53291
53283
  if (!type.members) {
53292
53284
  if (type.flags & 524288 /* Object */) {
@@ -55791,6 +55783,12 @@ function createTypeChecker(host) {
55791
55783
  i--;
55792
55784
  const source = types[i];
55793
55785
  if (hasEmptyObject || source.flags & 469499904 /* StructuredOrInstantiable */) {
55786
+ if (source.flags & 262144 /* TypeParameter */ && getBaseConstraintOrType(source).flags & 1048576 /* Union */) {
55787
+ if (isTypeRelatedTo(source, getUnionType(map(types, (t) => t === source ? neverType : t)), strictSubtypeRelation)) {
55788
+ orderedRemoveItemAt(types, i);
55789
+ }
55790
+ continue;
55791
+ }
55794
55792
  const keyProperty = source.flags & (524288 /* Object */ | 2097152 /* Intersection */ | 58982400 /* InstantiableNonPrimitive */) ? find(getPropertiesOfType(source), (p) => isUnitType(getTypeOfSymbol(p))) : void 0;
55795
55793
  const keyPropertyType = keyProperty && getRegularTypeOfLiteralType(getTypeOfSymbol(keyProperty));
55796
55794
  for (const target of types) {
@@ -56828,8 +56826,7 @@ function createTypeChecker(host) {
56828
56826
  }
56829
56827
  }
56830
56828
  if (isGenericMappedType(objectType)) {
56831
- const nameType = getNameTypeFromMappedType(objectType);
56832
- if (!nameType || isTypeAssignableTo(nameType, getTypeParameterFromMappedType(objectType))) {
56829
+ if (!getNameTypeFromMappedType(objectType) || isFilteringMappedType(objectType)) {
56833
56830
  return type[cache] = mapType(substituteIndexedMappedType(objectType, type.indexType), (t) => getSimplifiedType(t, writing));
56834
56831
  }
56835
56832
  }
@@ -58167,6 +58164,9 @@ function createTypeChecker(host) {
58167
58164
  function isTypeSubtypeOf(source, target) {
58168
58165
  return isTypeRelatedTo(source, target, subtypeRelation);
58169
58166
  }
58167
+ function isTypeStrictSubtypeOf(source, target) {
58168
+ return isTypeRelatedTo(source, target, strictSubtypeRelation);
58169
+ }
58170
58170
  function isTypeAssignableTo(source, target) {
58171
58171
  return isTypeRelatedTo(source, target, assignableRelation);
58172
58172
  }
@@ -60075,7 +60075,7 @@ function createTypeChecker(host) {
60075
60075
  0 /* None */
60076
60076
  );
60077
60077
  }
60078
- } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) {
60078
+ } else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) & 262144 /* NonInferrableType */))) {
60079
60079
  result2 &= propertiesRelatedTo(
60080
60080
  source2,
60081
60081
  target2,
@@ -61325,7 +61325,7 @@ function createTypeChecker(host) {
61325
61325
  const targetHasStringIndex = some(indexInfos, (info) => info.keyType === stringType);
61326
61326
  let result2 = -1 /* True */;
61327
61327
  for (const targetInfo of indexInfos) {
61328
- const related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
61328
+ const related = relation !== strictSubtypeRelation && !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* Any */ ? -1 /* True */ : isGenericMappedType(source2) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source2), targetInfo.type, 3 /* Both */, reportErrors2) : typeRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
61329
61329
  if (!related) {
61330
61330
  return 0 /* False */;
61331
61331
  }
@@ -65262,7 +65262,7 @@ function createTypeChecker(host) {
65262
65262
  const narrowedType = mapType(candidate, (c) => {
65263
65263
  const discriminant = keyPropertyName && getTypeOfPropertyOfType(c, keyPropertyName);
65264
65264
  const matching = discriminant && getConstituentTypeForKeyType(type, discriminant);
65265
- const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeSubtypeOf(c, t) && !isTypeIdenticalTo(c, t) ? c : isTypeSubtypeOf(t, c) ? t : neverType);
65265
+ const directlyRelated = mapType(matching || type, checkDerived ? (t) => isTypeDerivedFrom(t, c) ? t : isTypeDerivedFrom(c, t) ? c : neverType : (t) => isTypeStrictSubtypeOf(t, c) ? t : isTypeStrictSubtypeOf(c, t) ? c : isTypeSubtypeOf(t, c) ? t : isTypeSubtypeOf(c, t) ? c : neverType);
65266
65266
  return directlyRelated.flags & 131072 /* Never */ ? mapType(type, (t) => maybeTypeOfKind(t, 465829888 /* Instantiable */) && isRelated(c, getBaseConstraintOfType(t) || unknownType) ? getIntersectionType([t, c]) : neverType) : directlyRelated;
65267
65267
  });
65268
65268
  return !(narrowedType.flags & 131072 /* Never */) ? narrowedType : isTypeSubtypeOf(candidate, type) ? candidate : isTypeAssignableTo(type, candidate) ? type : isTypeAssignableTo(candidate, type) ? candidate : getIntersectionType([type, candidate]);
@@ -78993,14 +78993,14 @@ function createTypeChecker(host) {
78993
78993
  markAliasReferenced(sym, id);
78994
78994
  if (getAllSymbolFlags(sym) & 111551 /* Value */) {
78995
78995
  checkExpressionCached(id);
78996
- if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) {
78996
+ if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) {
78997
78997
  error(
78998
78998
  id,
78999
78999
  node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration : Diagnostics.An_export_default_must_reference_a_real_value_when_verbatimModuleSyntax_is_enabled_but_0_resolves_to_a_type_only_declaration,
79000
79000
  idText(id)
79001
79001
  );
79002
79002
  }
79003
- } else if (!isIllegalExportDefaultInCJS && compilerOptions.verbatimModuleSyntax) {
79003
+ } else if (!isIllegalExportDefaultInCJS && !(node.flags & 16777216 /* Ambient */) && compilerOptions.verbatimModuleSyntax) {
79004
79004
  error(
79005
79005
  id,
79006
79006
  node.isExportEquals ? Diagnostics.An_export_declaration_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type : Diagnostics.An_export_default_must_reference_a_value_when_verbatimModuleSyntax_is_enabled_but_0_only_refers_to_a_type,
@@ -91039,8 +91039,15 @@ function transformESDecorators(context) {
91039
91039
  false,
91040
91040
  visitor
91041
91041
  );
91042
- addRange(statements, initializerStatements);
91043
- addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart));
91042
+ const superStatementIndex = findSuperStatementIndex(node.body.statements, nonPrologueStart);
91043
+ if (superStatementIndex >= 0) {
91044
+ addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, nonPrologueStart, superStatementIndex + 1 - nonPrologueStart));
91045
+ addRange(statements, initializerStatements);
91046
+ addRange(statements, visitNodes2(node.body.statements, visitor, isStatement, superStatementIndex + 1));
91047
+ } else {
91048
+ addRange(statements, initializerStatements);
91049
+ addRange(statements, visitNodes2(node.body.statements, visitor, isStatement));
91050
+ }
91044
91051
  body = factory2.createBlock(
91045
91052
  statements,
91046
91053
  /*multiLine*/
@@ -112911,6 +112918,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
112911
112918
  const createProgramOptions = isArray(rootNamesOrOptions) ? createCreateProgramOptions(rootNamesOrOptions, _options, _host, _oldProgram, _configFileParsingDiagnostics) : rootNamesOrOptions;
112912
112919
  const { rootNames, options, configFileParsingDiagnostics, projectReferences, typeScriptVersion: typeScriptVersion2 } = createProgramOptions;
112913
112920
  let { oldProgram } = createProgramOptions;
112921
+ const reportInvalidIgnoreDeprecations = memoize(() => createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations));
112914
112922
  let processingDefaultLibFiles;
112915
112923
  let processingOtherFiles;
112916
112924
  let files;
@@ -115337,127 +115345,131 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
115337
115345
  }
115338
115346
  }
115339
115347
  }
115340
- function getVersionForDeprecationDiagnostics(reportInvalidIgnoreDeprecations) {
115341
- const version2 = typeScriptVersion2 || versionMajorMinor;
115348
+ function getIgnoreDeprecationsVersion() {
115342
115349
  const ignoreDeprecations = options.ignoreDeprecations;
115343
115350
  if (ignoreDeprecations) {
115344
- if (ignoreDeprecations === "5.0" /* v5_0 */ && (version2 === "5.0" /* v5_0 */ || version2 === "5.5" /* v5_5 */)) {
115345
- return;
115346
- } else if (reportInvalidIgnoreDeprecations) {
115347
- createOptionValueDiagnostic("ignoreDeprecations", Diagnostics.Invalid_value_for_ignoreDeprecations);
115348
- }
115351
+ if (ignoreDeprecations === "5.0") {
115352
+ return new Version(ignoreDeprecations);
115353
+ }
115354
+ reportInvalidIgnoreDeprecations();
115355
+ }
115356
+ return Version.zero;
115357
+ }
115358
+ function checkDeprecations(deprecatedIn, removedIn, createDiagnostic, fn) {
115359
+ const deprecatedInVersion = new Version(deprecatedIn);
115360
+ const removedInVersion = new Version(removedIn);
115361
+ const typescriptVersion = new Version(typeScriptVersion2 || versionMajorMinor);
115362
+ const ignoreDeprecationsVersion = getIgnoreDeprecationsVersion();
115363
+ const mustBeRemoved = !(removedInVersion.compareTo(typescriptVersion) === 1 /* GreaterThan */);
115364
+ const canBeSilenced = !mustBeRemoved && ignoreDeprecationsVersion.compareTo(deprecatedInVersion) === -1 /* LessThan */;
115365
+ if (mustBeRemoved || canBeSilenced) {
115366
+ fn((name, value, useInstead) => {
115367
+ if (mustBeRemoved) {
115368
+ if (value === void 0) {
115369
+ createDiagnostic(name, value, useInstead, Diagnostics.Option_0_has_been_removed_Please_remove_it_from_your_configuration, name);
115370
+ } else {
115371
+ createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_has_been_removed_Please_remove_it_from_your_configuration, name, value);
115372
+ }
115373
+ } else {
115374
+ if (value === void 0) {
115375
+ createDiagnostic(name, value, useInstead, Diagnostics.Option_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, name, removedIn, deprecatedIn);
115376
+ } else {
115377
+ createDiagnostic(name, value, useInstead, Diagnostics.Option_0_1_is_deprecated_and_will_stop_functioning_in_TypeScript_2_Specify_compilerOption_ignoreDeprecations_Colon_3_to_silence_this_error, name, value, removedIn, deprecatedIn);
115378
+ }
115379
+ }
115380
+ });
115349
115381
  }
115350
- return version2;
115351
115382
  }
115352
115383
  function verifyDeprecatedCompilerOptions() {
115353
- const version2 = getVersionForDeprecationDiagnostics(
115354
- /*reportInvalidIgnoreDeprecations*/
115355
- true
115356
- );
115357
- if (!version2)
115358
- return;
115359
- if (options.target === 0 /* ES3 */) {
115360
- createDeprecatedDiagnosticForOption(version2, "target", "ES3");
115361
- }
115362
- if (options.noImplicitUseStrict) {
115363
- createDeprecatedDiagnosticForOption(version2, "noImplicitUseStrict");
115364
- }
115365
- if (options.keyofStringsOnly) {
115366
- createDeprecatedDiagnosticForOption(version2, "keyofStringsOnly");
115367
- }
115368
- if (options.suppressExcessPropertyErrors) {
115369
- createDeprecatedDiagnosticForOption(version2, "suppressExcessPropertyErrors");
115370
- }
115371
- if (options.suppressImplicitAnyIndexErrors) {
115372
- createDeprecatedDiagnosticForOption(version2, "suppressImplicitAnyIndexErrors");
115373
- }
115374
- if (options.noStrictGenericChecks) {
115375
- createDeprecatedDiagnosticForOption(version2, "noStrictGenericChecks");
115376
- }
115377
- if (options.charset) {
115378
- createDeprecatedDiagnosticForOption(version2, "charset");
115379
- }
115380
- if (options.out) {
115381
- createDeprecatedDiagnosticForOption(version2, "out");
115382
- }
115383
- if (options.importsNotUsedAsValues) {
115384
- createDeprecatedDiagnosticForOption(
115385
- version2,
115386
- "importsNotUsedAsValues",
115387
- /*value*/
115388
- void 0,
115389
- "verbatimModuleSyntax"
115390
- );
115391
- }
115392
- if (options.preserveValueImports) {
115393
- createDeprecatedDiagnosticForOption(
115394
- version2,
115395
- "preserveValueImports",
115396
- /*value*/
115397
- void 0,
115398
- "verbatimModuleSyntax"
115399
- );
115400
- }
115401
- }
115402
- function verifyDeprecatedProjectReference(ref, parentFile, index) {
115403
- if (ref.prepend) {
115404
- const version2 = getVersionForDeprecationDiagnostics(
115405
- /*reportInvalidIgnoreDeprecations*/
115406
- false
115407
- );
115408
- if (version2) {
115409
- createDeprecatedOptionForVersionDiagnostic(
115410
- version2,
115411
- (message, arg0, arg1, arg2) => createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2),
115412
- "prepend"
115384
+ function createDiagnostic(name, value, useInstead, message, arg0, arg1, arg2, arg3) {
115385
+ if (useInstead) {
115386
+ const details = chainDiagnosticMessages(
115387
+ /*details*/
115388
+ void 0,
115389
+ Diagnostics.Use_0_instead,
115390
+ useInstead
115391
+ );
115392
+ const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2, arg3);
115393
+ createDiagnosticForOption(
115394
+ /*onKey*/
115395
+ !value,
115396
+ name,
115397
+ /*option2*/
115398
+ void 0,
115399
+ chain
115400
+ );
115401
+ } else {
115402
+ createDiagnosticForOption(
115403
+ /*onKey*/
115404
+ !value,
115405
+ name,
115406
+ /*option2*/
115407
+ void 0,
115408
+ message,
115409
+ arg0,
115410
+ arg1,
115411
+ arg2,
115412
+ arg3
115413
115413
  );
115414
115414
  }
115415
115415
  }
115416
+ checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => {
115417
+ if (options.target === 0 /* ES3 */) {
115418
+ createDeprecatedDiagnostic("target", "ES3");
115419
+ }
115420
+ if (options.noImplicitUseStrict) {
115421
+ createDeprecatedDiagnostic("noImplicitUseStrict");
115422
+ }
115423
+ if (options.keyofStringsOnly) {
115424
+ createDeprecatedDiagnostic("keyofStringsOnly");
115425
+ }
115426
+ if (options.suppressExcessPropertyErrors) {
115427
+ createDeprecatedDiagnostic("suppressExcessPropertyErrors");
115428
+ }
115429
+ if (options.suppressImplicitAnyIndexErrors) {
115430
+ createDeprecatedDiagnostic("suppressImplicitAnyIndexErrors");
115431
+ }
115432
+ if (options.noStrictGenericChecks) {
115433
+ createDeprecatedDiagnostic("noStrictGenericChecks");
115434
+ }
115435
+ if (options.charset) {
115436
+ createDeprecatedDiagnostic("charset");
115437
+ }
115438
+ if (options.out) {
115439
+ createDeprecatedDiagnostic(
115440
+ "out",
115441
+ /*value*/
115442
+ void 0,
115443
+ "outFile"
115444
+ );
115445
+ }
115446
+ if (options.importsNotUsedAsValues) {
115447
+ createDeprecatedDiagnostic(
115448
+ "importsNotUsedAsValues",
115449
+ /*value*/
115450
+ void 0,
115451
+ "verbatimModuleSyntax"
115452
+ );
115453
+ }
115454
+ if (options.preserveValueImports) {
115455
+ createDeprecatedDiagnostic(
115456
+ "preserveValueImports",
115457
+ /*value*/
115458
+ void 0,
115459
+ "verbatimModuleSyntax"
115460
+ );
115461
+ }
115462
+ });
115416
115463
  }
115417
- function createDeprecatedDiagnosticForOption(version2, name, value, useInstead) {
115418
- return createDeprecatedOptionForVersionDiagnostic(
115419
- version2,
115420
- (message, arg0, arg1, arg2) => {
115421
- if (useInstead) {
115422
- const details = chainDiagnosticMessages(
115423
- /*details*/
115424
- void 0,
115425
- Diagnostics.Use_0_instead,
115426
- useInstead
115427
- );
115428
- const chain = chainDiagnosticMessages(details, message, arg0, arg1, arg2);
115429
- createDiagnosticForOption(
115430
- /*onKey*/
115431
- !value,
115432
- name,
115433
- /*option2*/
115434
- void 0,
115435
- chain
115436
- );
115437
- } else {
115438
- createDiagnosticForOption(
115439
- /*onKey*/
115440
- !value,
115441
- name,
115442
- /*option2*/
115443
- void 0,
115444
- message,
115445
- arg0,
115446
- arg1,
115447
- arg2
115448
- );
115449
- }
115450
- },
115451
- name,
115452
- value
115453
- );
115454
- }
115455
- function createDeprecatedOptionForVersionDiagnostic(version2, createDiagnostic, name, value) {
115456
- if (version2 === "6.0" /* v6_0 */) {
115457
- createDiagnostic(Diagnostics.Flag_0_is_deprecated_Please_remove_it_from_your_configuration, value || name);
115458
- } else {
115459
- createDiagnostic(Diagnostics.Flag_0_is_deprecated_and_will_stop_functioning_in_TypeScript_1_Specify_compilerOption_ignoreDeprecations_Colon_2_to_silence_this_error, value || name, "5.5" /* v5_5 */, "5.0" /* v5_0 */);
115464
+ function verifyDeprecatedProjectReference(ref, parentFile, index) {
115465
+ function createDiagnostic(_name, _value, _useInstead, message, arg0, arg1, arg2, arg3) {
115466
+ createDiagnosticForReference(parentFile, index, message, arg0, arg1, arg2, arg3);
115460
115467
  }
115468
+ checkDeprecations("5.0", "5.5", createDiagnostic, (createDeprecatedDiagnostic) => {
115469
+ if (ref.prepend) {
115470
+ createDeprecatedDiagnostic("prepend");
115471
+ }
115472
+ });
115461
115473
  }
115462
115474
  function createDiagnosticExplainingFile(file, fileProcessingReason, diagnostic, args) {
115463
115475
  var _a3;
@@ -115710,25 +115722,25 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
115710
115722
  arg1
115711
115723
  );
115712
115724
  }
115713
- function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2) {
115725
+ function createDiagnosticForReference(sourceFile, index, message, arg0, arg1, arg2, arg3) {
115714
115726
  const referencesSyntax = firstDefined(
115715
115727
  getTsConfigPropArray(sourceFile || options.configFile, "references"),
115716
115728
  (property) => isArrayLiteralExpression(property.initializer) ? property.initializer : void 0
115717
115729
  );
115718
115730
  if (referencesSyntax && referencesSyntax.elements.length > index) {
115719
- programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2));
115731
+ programDiagnostics.add(createDiagnosticForNodeInSourceFile(sourceFile || options.configFile, referencesSyntax.elements[index], message, arg0, arg1, arg2, arg3));
115720
115732
  } else {
115721
- programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2));
115733
+ programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3));
115722
115734
  }
115723
115735
  }
115724
- function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2) {
115736
+ function createDiagnosticForOption(onKey, option1, option2, message, arg0, arg1, arg2, arg3) {
115725
115737
  const compilerOptionsObjectLiteralSyntax = getCompilerOptionsObjectLiteralSyntax();
115726
- const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2);
115738
+ const needCompilerDiagnostic = !compilerOptionsObjectLiteralSyntax || !createOptionDiagnosticInObjectLiteralSyntax(compilerOptionsObjectLiteralSyntax, onKey, option1, option2, message, arg0, arg1, arg2, arg3);
115727
115739
  if (needCompilerDiagnostic) {
115728
115740
  if ("messageText" in message) {
115729
115741
  programDiagnostics.add(createCompilerDiagnosticFromMessageChain(message));
115730
115742
  } else {
115731
- programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2));
115743
+ programDiagnostics.add(createCompilerDiagnostic(message, arg0, arg1, arg2, arg3));
115732
115744
  }
115733
115745
  }
115734
115746
  }
@@ -115747,13 +115759,13 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
115747
115759
  }
115748
115760
  return _compilerOptionsObjectLiteralSyntax || void 0;
115749
115761
  }
115750
- function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2) {
115762
+ function createOptionDiagnosticInObjectLiteralSyntax(objectLiteral, onKey, key1, key2, message, arg0, arg1, arg2, arg3) {
115751
115763
  const props = getPropertyAssignment(objectLiteral, key1, key2);
115752
115764
  for (const prop of props) {
115753
115765
  if ("messageText" in message) {
115754
115766
  programDiagnostics.add(createDiagnosticForNodeFromMessageChain(options.configFile, onKey ? prop.name : prop.initializer, message));
115755
115767
  } else {
115756
- programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2));
115768
+ programDiagnostics.add(createDiagnosticForNodeInSourceFile(options.configFile, onKey ? prop.name : prop.initializer, message, arg0, arg1, arg2, arg3));
115757
115769
  }
115758
115770
  }
115759
115771
  return !!props.length;
@@ -119817,7 +119829,6 @@ function createWatchProgram(host) {
119817
119829
  );
119818
119830
  }
119819
119831
  function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions2, watchType) {
119820
- Debug.assert(configFileName);
119821
119832
  updateSharedExtendedConfigFileWatcher(
119822
119833
  forProjectPath,
119823
119834
  options,
@@ -119833,7 +119844,7 @@ function createWatchProgram(host) {
119833
119844
  if (!(projects == null ? void 0 : projects.size))
119834
119845
  return;
119835
119846
  projects.forEach((projectPath) => {
119836
- if (toPath3(configFileName) === projectPath) {
119847
+ if (configFileName && toPath3(configFileName) === projectPath) {
119837
119848
  reloadLevel = 2 /* Full */;
119838
119849
  } else {
119839
119850
  const config = parsedConfigs == null ? void 0 : parsedConfigs.get(projectPath);