Merge branch 'main' into fix47668

# Conflicts:
#	src/compiler/diagnosticMessages.json
This commit is contained in:
Anders Hejlsberg
2022-02-15 07:39:45 +01:00
275 changed files with 8803 additions and 1844 deletions
@@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Configure git and update package-lock.json
- name: Configure git
run: |
git config --global user.email "typescriptbot@microsoft.com"
git config --global user.name "TypeScript Bot"
@@ -30,6 +30,7 @@ jobs:
run: |
cd ts-site
git commit --allow-empty -m "Monthly Bump"
git config --unset-all http.https://github.com/.extraheader
git push https://${{ secrets.TS_BOT_GITHUB_TOKEN }}@github.com/microsoft/TypeScript-Website.git
- uses: actions/checkout@v2
@@ -41,4 +42,5 @@ jobs:
run: |
cd monaco-builds
git commit --allow-empty -m "Monthly Bump"
git config --unset-all http.https://github.com/.extraheader
git push https://${{ secrets.TS_BOT_GITHUB_TOKEN }}@github.com/microsoft/TypeScript-Make-Monaco-Builds.git
+3 -3
View File
@@ -130,7 +130,7 @@
"Add_await_to_initializer_for_0_95084": "将 \"await\" 添加到 \"{0}\" 的初始值设定项",
"Add_await_to_initializers_95089": "将 \"await\" 添加到初始值设定项",
"Add_braces_to_arrow_function_95059": "向箭头函数添加大括号",
"Add_class_tag_95102": "添加“@”标记",
"Add_class_tag_95102": "添加“@class”标记",
"Add_const_to_all_unresolved_variables_95082": "将 \"const\" 添加到所有未解析变量",
"Add_const_to_unresolved_variable_95081": "将 \"const\" 添加到未解析的变量",
"Add_default_import_0_to_existing_import_declaration_from_1_90033": "将默认导入 \"{0}\" 从 \"{1}\" 添加到现有导入声明。",
@@ -154,7 +154,7 @@
"Add_parameter_name_90034": "添加参数名称",
"Add_qualifier_to_all_unresolved_variables_matching_a_member_name_95037": "将限定符添加到匹配成员名称的所有未解析变量",
"Add_this_parameter_95104": "添加“此”参数。",
"Add_this_tag_95103": "添加“@”标记",
"Add_this_tag_95103": "添加“@this”标记",
"Add_to_all_uncalled_decorators_95044": "将 \"()\" 添加到所有未调用的修饰器",
"Add_ts_ignore_to_all_error_messages_95042": "将 \"@ts-ignore\" 添加到所有错误消息",
"Add_undefined_to_a_type_when_accessed_using_an_index_6674": "使用索引访问时,将 “undefined” 添加到类型。",
@@ -1784,4 +1784,4 @@
"with_statements_are_not_allowed_in_strict_mode_1101": "严格模式下不允许使用 \"with\" 语句。",
"yield_expression_implicitly_results_in_an_any_type_because_its_containing_generator_lacks_a_return_t_7057": "\"yield\" 表达式隐式导致 \"any\" 类型,因为它的包含生成器缺少返回类型批注。",
"yield_expressions_cannot_be_used_in_a_parameter_initializer_2523": "不能在参数初始化表达式中使用 \"yield\" 表达式。"
}
}
+14 -22
View File
@@ -1,6 +1,6 @@
{
"name": "typescript",
"version": "4.6.0",
"version": "4.7.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@@ -367,17 +367,6 @@
"is-plain-object": "^5.0.0",
"node-fetch": "^2.6.7",
"universal-user-agent": "^6.0.0"
},
"dependencies": {
"node-fetch": {
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"dev": true,
"requires": {
"whatwg-url": "^5.0.0"
}
}
}
},
"@octokit/request-error": {
@@ -687,9 +676,9 @@
"dev": true
},
"@types/node": {
"version": "17.0.13",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.13.tgz",
"integrity": "sha512-Y86MAxASe25hNzlDbsviXl8jQHb0RDvKt4c40ZJQ1Don0AAL0STLZSs4N+6gLEO55pedy7r2cLwS+ZDxPm/2Bw==",
"version": "17.0.18",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.18.tgz",
"integrity": "sha512-eKj4f/BsN/qcculZiRSujogjvp5O/k4lOW5m35NopjZM/QwLOR075a8pJW5hD+Rtdm2DaCVPENS6KtSQnUD6BA==",
"dev": true
},
"@types/node-fetch": {
@@ -5124,9 +5113,9 @@
}
},
"loupe": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.1.tgz",
"integrity": "sha512-EN1D3jyVmaX4tnajVlfbREU4axL647hLec1h/PXAb8CPDMJiYitcWF2UeLVNttRqaIqQs4x+mRvXf+d+TlDrCA==",
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz",
"integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==",
"dev": true,
"requires": {
"get-func-name": "^2.0.0"
@@ -5848,10 +5837,13 @@
"dev": true
},
"node-fetch": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
"dev": true
"version": "2.6.7",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
"dev": true,
"requires": {
"whatwg-url": "^5.0.0"
}
},
"normalize-package-data": {
"version": "2.5.0",
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "typescript",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "4.6.0",
"version": "4.7.0",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [
+214 -125
View File
@@ -175,12 +175,15 @@ namespace ts {
}
const enum CheckMode {
Normal = 0, // Normal type checking
Contextual = 1 << 0, // Explicitly assigned contextual type, therefore not cacheable
Inferential = 1 << 1, // Inferential typing
SkipContextSensitive = 1 << 2, // Skip context sensitive function expressions
SkipGenericFunctions = 1 << 3, // Skip single signature generic functions
IsForSignatureHelp = 1 << 4, // Call resolution for purposes of signature help
Normal = 0, // Normal type checking
Contextual = 1 << 0, // Explicitly assigned contextual type, therefore not cacheable
Inferential = 1 << 1, // Inferential typing
SkipContextSensitive = 1 << 2, // Skip context sensitive function expressions
SkipGenericFunctions = 1 << 3, // Skip single signature generic functions
IsForSignatureHelp = 1 << 4, // Call resolution for purposes of signature help
RestBindingElement = 1 << 5, // Checking a type that is going to be used to determine the type of a rest binding element
// e.g. in `const { a, ...rest } = foo`, when checking the type of `foo` to determine the type of `rest`,
// we need to preserve generic types instead of substituting them for constraints
}
const enum SignatureCheckMode {
@@ -1316,13 +1319,14 @@ namespace ts {
else { // error
const isEitherEnum = !!(target.flags & SymbolFlags.Enum || source.flags & SymbolFlags.Enum);
const isEitherBlockScoped = !!(target.flags & SymbolFlags.BlockScopedVariable || source.flags & SymbolFlags.BlockScopedVariable);
const message = isEitherEnum
? Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations
: isEitherBlockScoped
? Diagnostics.Cannot_redeclare_block_scoped_variable_0
: Diagnostics.Duplicate_identifier_0;
const message = isEitherEnum ? Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations
: isEitherBlockScoped ? Diagnostics.Cannot_redeclare_block_scoped_variable_0
: Diagnostics.Duplicate_identifier_0;
const sourceSymbolFile = source.declarations && getSourceFileOfNode(source.declarations[0]);
const targetSymbolFile = target.declarations && getSourceFileOfNode(target.declarations[0]);
const isSourcePlainJs = isPlainJsFile(sourceSymbolFile, compilerOptions.checkJs);
const isTargetPlainJs = isPlainJsFile(targetSymbolFile, compilerOptions.checkJs);
const symbolName = symbolToString(source);
// Collect top-level duplicate identifier errors into one mapping, so we can then merge their diagnostics if there are a bunch
@@ -1333,12 +1337,12 @@ namespace ts {
({ firstFile, secondFile, conflictingSymbols: new Map() } as DuplicateInfoForFiles));
const conflictingSymbolInfo = getOrUpdate(filesDuplicates.conflictingSymbols, symbolName, () =>
({ isBlockScoped: isEitherBlockScoped, firstFileLocations: [], secondFileLocations: [] } as DuplicateInfoForSymbol));
addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source);
addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target);
if (!isSourcePlainJs) addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source);
if (!isTargetPlainJs) addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target);
}
else {
addDuplicateDeclarationErrorsForSymbols(source, message, symbolName, target);
addDuplicateDeclarationErrorsForSymbols(target, message, symbolName, source);
if (!isSourcePlainJs) addDuplicateDeclarationErrorsForSymbols(source, message, symbolName, target);
if (!isTargetPlainJs) addDuplicateDeclarationErrorsForSymbols(target, message, symbolName, source);
}
}
return target;
@@ -1832,6 +1836,8 @@ namespace ts {
// type parameters are visible in parameter list, return type and type parameter list
? lastLocation === (location as FunctionLikeDeclaration).type ||
lastLocation.kind === SyntaxKind.Parameter ||
lastLocation.kind === SyntaxKind.JSDocParameterTag ||
lastLocation.kind === SyntaxKind.JSDocReturnTag ||
lastLocation.kind === SyntaxKind.TypeParameter
// local types not visible outside the function body
: false;
@@ -2100,8 +2106,8 @@ namespace ts {
lastSelfReferenceLocation = location;
}
lastLocation = location;
location = isJSDocTemplateTag(location) ?
getEffectiveContainerForJSDocTemplateTag(location) || location.parent :
location = isJSDocTemplateTag(location) ? getEffectiveContainerForJSDocTemplateTag(location) || location.parent :
isJSDocParameterTag(location) || isJSDocReturnTag(location) ? getHostSignatureFromJSDoc(location) || location.parent :
location.parent;
}
@@ -3373,16 +3379,20 @@ namespace ts {
return;
}
const host = getJSDocHost(node);
if (host &&
isExpressionStatement(host) &&
isBinaryExpression(host.expression) &&
getAssignmentDeclarationKind(host.expression) === AssignmentDeclarationKind.PrototypeProperty) {
// X.prototype.m = /** @param {K} p */ function () { } <-- look for K on X's declaration
if (host && isExpressionStatement(host) && isPrototypePropertyAssignment(host.expression)) {
// /** @param {K} p */ X.prototype.m = function () { } <-- look for K on X's declaration
const symbol = getSymbolOfNode(host.expression.left);
if (symbol) {
return getDeclarationOfJSPrototypeContainer(symbol);
}
}
if (host && isFunctionExpression(host) && isPrototypePropertyAssignment(host.parent) && isExpressionStatement(host.parent.parent)) {
// X.prototype.m = /** @param {K} p */ function () { } <-- look for K on X's declaration
const symbol = getSymbolOfNode(host.parent.left);
if (symbol) {
return getDeclarationOfJSPrototypeContainer(symbol);
}
}
if (host && (isObjectLiteralMethod(host) || isPropertyAssignment(host)) &&
isBinaryExpression(host.parent.parent) &&
getAssignmentDeclarationKind(host.parent.parent) === AssignmentDeclarationKind.Prototype) {
@@ -3970,8 +3980,15 @@ namespace ts {
return res;
}
const candidates = mapDefined(symbol.declarations, d => {
if (!isAmbientModule(d) && d.parent && hasNonGlobalAugmentationExternalModuleSymbol(d.parent)) {
return getSymbolOfNode(d.parent);
if (!isAmbientModule(d) && d.parent){
// direct children of a module
if (hasNonGlobalAugmentationExternalModuleSymbol(d.parent)) {
return getSymbolOfNode(d.parent);
}
// export ='d member of an ambient module
if (isModuleBlock(d.parent) && d.parent.parent && resolveExternalModuleSymbol(getSymbolOfNode(d.parent.parent)) === symbol) {
return getSymbolOfNode(d.parent.parent);
}
}
if (isClassExpression(d) && isBinaryExpression(d.parent) && d.parent.operatorToken.kind === SyntaxKind.EqualsToken && isAccessExpression(d.parent.left) && isEntityNameExpression(d.parent.left.expression)) {
if (isModuleExportsAccessExpression(d.parent.left) || isExportsIdentifier(d.parent.left.expression)) {
@@ -8454,9 +8471,12 @@ namespace ts {
// Return the type of a binding element parent. We check SymbolLinks first to see if a type has been
// assigned by contextual typing.
function getTypeForBindingElementParent(node: BindingElementGrandparent) {
function getTypeForBindingElementParent(node: BindingElementGrandparent, checkMode: CheckMode) {
if (checkMode !== CheckMode.Normal) {
return getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false, checkMode);
}
const symbol = getSymbolOfNode(node);
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false);
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false, checkMode);
}
function getRestType(source: Type, properties: PropertyName[], symbol: Symbol | undefined): Type {
@@ -8587,7 +8607,8 @@ namespace ts {
/** Return the inferred type for a binding element */
function getTypeForBindingElement(declaration: BindingElement): Type | undefined {
const parentType = getTypeForBindingElementParent(declaration.parent.parent);
const checkMode = declaration.dotDotDotToken ? CheckMode.RestBindingElement : CheckMode.Normal;
const parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
return parentType && getBindingElementTypeFromParentType(declaration, parentType);
}
@@ -8660,9 +8681,9 @@ namespace ts {
if (getEffectiveTypeAnnotationNode(walkUpBindingElementsAndPatterns(declaration))) {
// In strict null checking mode, if a default value of a non-undefined type is specified, remove
// undefined from the final type.
return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & TypeFlags.Undefined) ? getNonUndefinedType(type) : type;
return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration, CheckMode.Normal)) & TypeFlags.Undefined) ? getNonUndefinedType(type) : type;
}
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration)], UnionReduction.Subtype));
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, CheckMode.Normal)], UnionReduction.Subtype));
}
function getTypeForDeclarationFromJSDocComment(declaration: Node) {
@@ -8688,11 +8709,15 @@ namespace ts {
}
// Return the inferred type for a variable, parameter, or property declaration
function getTypeForVariableLikeDeclaration(declaration: ParameterDeclaration | PropertyDeclaration | PropertySignature | VariableDeclaration | BindingElement | JSDocPropertyLikeTag, includeOptionality: boolean): Type | undefined {
function getTypeForVariableLikeDeclaration(
declaration: ParameterDeclaration | PropertyDeclaration | PropertySignature | VariableDeclaration | BindingElement | JSDocPropertyLikeTag,
includeOptionality: boolean,
checkMode: CheckMode,
): Type | undefined {
// A variable declared in a for..in statement is of type string, or of type keyof T when the
// right hand expression is of a type parameter type.
if (isVariableDeclaration(declaration) && declaration.parent.parent.kind === SyntaxKind.ForInStatement) {
const indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression)));
const indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression, /*checkMode*/ checkMode)));
return indexType.flags & (TypeFlags.TypeParameter | TypeFlags.Index) ? getExtractStringType(indexType) : stringType;
}
@@ -8754,12 +8779,8 @@ namespace ts {
}
}
if (isInJSFile(declaration)) {
const typeTag = getJSDocType(func);
if (typeTag && isFunctionTypeNode(typeTag)) {
const signature = getSignatureFromDeclaration(typeTag);
const pos = func.parameters.indexOf(declaration);
return declaration.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos);
}
const type = getParameterTypeOfTypeTag(func, declaration);
if (type) return type;
}
// Use contextual parameter type if one is available
const type = declaration.symbol.escapedName === InternalSymbolName.This ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration);
@@ -8777,7 +8798,7 @@ namespace ts {
return containerObjectType;
}
}
const type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration));
const type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration, checkMode));
return addOptionality(type, isProperty, isOptional);
}
@@ -9170,7 +9191,7 @@ namespace ts {
// contextual type or, if the element itself is a binding pattern, with the type implied by that binding
// pattern.
const contextualType = isBindingPattern(element.name) ? getTypeFromBindingPattern(element.name, /*includePatternInType*/ true, /*reportErrors*/ false) : unknownType;
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, contextualType)));
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, CheckMode.Normal, contextualType)));
}
if (isBindingPattern(element.name)) {
return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors);
@@ -9262,7 +9283,7 @@ namespace ts {
// binding pattern [x, s = ""]. Because the contextual type is a tuple type, the resulting type of [1, "one"] is the
// tuple type [number, string]. Thus, the type inferred for 'x' is number and the type inferred for 's' is string.
function getWidenedTypeForVariableLikeDeclaration(declaration: ParameterDeclaration | PropertyDeclaration | PropertySignature | VariableDeclaration | BindingElement | JSDocPropertyLikeTag, reportErrors?: boolean): Type {
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true), declaration, reportErrors);
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true, CheckMode.Normal), declaration, reportErrors);
}
function isGlobalSymbolConstructor(node: Node) {
@@ -9510,11 +9531,12 @@ namespace ts {
const getter = getDeclarationOfKind<AccessorDeclaration>(symbol, SyntaxKind.GetAccessor);
const setter = getDeclarationOfKind<AccessorDeclaration>(symbol, SyntaxKind.SetAccessor);
const setterType = getAnnotatedAccessorType(setter);
// For write operations, prioritize type annotations on the setter
if (writing && setterType) {
return instantiateTypeIfNeeded(setterType, symbol);
if (writing) {
const setterType = getAnnotatedAccessorType(setter);
if (setterType) {
return instantiateTypeIfNeeded(setterType, symbol);
}
}
// Else defer to the getter type
@@ -9532,6 +9554,7 @@ namespace ts {
}
// If the user didn't specify a return type, try to use the set-accessor's parameter type.
const setterType = getAnnotatedAccessorType(setter);
if (setterType) {
return setterType;
}
@@ -9695,6 +9718,41 @@ namespace ts {
return links.type;
}
function getWriteTypeOfSymbolWithDeferredType(symbol: Symbol): Type | undefined {
const links = getSymbolLinks(symbol);
if (!links.writeType && links.deferralWriteConstituents) {
Debug.assertIsDefined(links.deferralParent);
Debug.assertIsDefined(links.deferralConstituents);
links.writeType = links.deferralParent.flags & TypeFlags.Union ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents);
}
return links.writeType;
}
/**
* Distinct write types come only from set accessors, but union and intersection
* properties deriving from set accessors will either pre-compute or defer the
* union or intersection of the writeTypes of their constituents. To account for
* this, we will assume that any deferred type or transient symbol may have a
* `writeType` (or a deferred write type ready to be computed) that should be
* used before looking for set accessor declarations.
*/
function getWriteTypeOfSymbol(symbol: Symbol): Type {
const checkFlags = getCheckFlags(symbol);
if (checkFlags & CheckFlags.DeferredType) {
const writeType = getWriteTypeOfSymbolWithDeferredType(symbol);
if (writeType) {
return writeType;
}
}
if (symbol.flags & SymbolFlags.Transient) {
const { writeType } = symbol as TransientSymbol;
if (writeType) {
return writeType;
}
}
return getSetAccessorTypeOfSymbol(symbol);
}
function getSetAccessorTypeOfSymbol(symbol: Symbol): Type {
if (symbol.flags & SymbolFlags.Accessor) {
const type = getTypeOfSetAccessor(symbol);
@@ -12197,6 +12255,7 @@ namespace ts {
let firstType: Type | undefined;
let nameType: Type | undefined;
const propTypes: Type[] = [];
let writeTypes: Type[] | undefined;
let firstValueDeclaration: Declaration | undefined;
let hasNonUniformValueDeclaration = false;
for (const prop of props) {
@@ -12212,6 +12271,10 @@ namespace ts {
firstType = type;
nameType = getSymbolLinks(prop).nameType;
}
const writeType = getWriteTypeOfSymbol(prop);
if (writeTypes || writeType !== type) {
writeTypes = append(!writeTypes ? propTypes.slice() : writeTypes, writeType);
}
else if (type !== firstType) {
checkFlags |= CheckFlags.HasNonUniformType;
}
@@ -12242,9 +12305,13 @@ namespace ts {
result.checkFlags |= CheckFlags.DeferredType;
result.deferralParent = containingType;
result.deferralConstituents = propTypes;
result.deferralWriteConstituents = writeTypes;
}
else {
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
if (writeTypes) {
result.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
}
}
return result;
}
@@ -12711,6 +12778,13 @@ namespace ts {
return typeTag?.typeExpression && getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression));
}
function getParameterTypeOfTypeTag(func: FunctionLikeDeclaration, parameter: ParameterDeclaration) {
const signature = getSignatureOfTypeTag(func);
if (!signature) return undefined;
const pos = func.parameters.indexOf(parameter);
return parameter.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos);
}
function getReturnTypeOfTypeTag(node: SignatureDeclaration | JSDocSignature) {
const signature = getSignatureOfTypeTag(node);
return signature && getReturnTypeOfSignature(signature);
@@ -13505,7 +13579,7 @@ namespace ts {
function getImpliedConstraint(type: Type, checkNode: TypeNode, extendsNode: TypeNode): Type | undefined {
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, (checkNode as TupleTypeNode).elements[0], (extendsNode as TupleTypeNode).elements[0]) :
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) :
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) :
undefined;
}
@@ -17832,8 +17906,10 @@ namespace ts {
(source as LiteralType).value === (target as LiteralType).value &&
isEnumTypeRelatedTo(getParentOfSymbol(source.symbol)!, getParentOfSymbol(target.symbol)!, errorReporter)) return true;
}
if (s & TypeFlags.Undefined && (!strictNullChecks || t & (TypeFlags.Undefined | TypeFlags.Void))) return true;
if (s & TypeFlags.Null && (!strictNullChecks || t & TypeFlags.Null)) return true;
// In non-strictNullChecks mode, `undefined` and `null` are assignable to anything except `never`.
// Since unions and intersections may reduce to `never`, we exclude them here.
if (s & TypeFlags.Undefined && (!strictNullChecks && !(t & TypeFlags.UnionOrIntersection) || t & (TypeFlags.Undefined | TypeFlags.Void))) return true;
if (s & TypeFlags.Null && (!strictNullChecks && !(t & TypeFlags.UnionOrIntersection) || t & TypeFlags.Null)) return true;
if (s & TypeFlags.Object && t & TypeFlags.NonPrimitive) return true;
if (relation === assignableRelation || relation === comparableRelation) {
if (s & TypeFlags.Any) return true;
@@ -19351,6 +19427,11 @@ namespace ts {
}
if (getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference && (source as TypeReference).target === (target as TypeReference).target &&
!isTupleType(source) && !(getObjectFlags(source) & ObjectFlags.MarkerType || getObjectFlags(target) & ObjectFlags.MarkerType)) {
// When strictNullChecks is disabled, the element type of the empty array literal is undefinedWideningType,
// and an empty array literal wouldn't be assignable to a `never[]` without this check.
if (isEmptyArrayLiteralType(source)) {
return Ternary.True;
}
// We have type references to the same generic type, and the type references are not marker
// type references (which are intended by be compared structurally). Obtain the variance
// information for the type parameters and relate the type arguments accordingly.
@@ -19656,6 +19737,18 @@ namespace ts {
}
return Ternary.False;
}
// Ensure {readonly a: whatever} is not a subtype of {a: whatever},
// while {a: whatever} is a subtype of {readonly a: whatever}.
// This ensures the subtype relationship is ordered, and preventing declaration order
// from deciding which type "wins" in union subtype reduction.
// They're still assignable to one another, since `readonly` doesn't affect assignability.
if (
(relation === subtypeRelation || relation === strictSubtypeRelation) &&
!!(sourcePropFlags & ModifierFlags.Readonly) && !(targetPropFlags & ModifierFlags.Readonly)
) {
return Ternary.False;
}
// If the target comes from a partial union prop, allow `undefined` in the target type
const related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState);
if (!related) {
@@ -24960,12 +25053,16 @@ namespace ts {
return !!(type.flags & TypeFlags.Instantiable && !maybeTypeOfKind(getBaseConstraintOrType(type), TypeFlags.Nullable));
}
function hasNonBindingPatternContextualTypeWithNoGenericTypes(node: Node) {
function hasContextualTypeWithNoGenericTypes(node: Node, checkMode: CheckMode | undefined) {
// Computing the contextual type for a child of a JSX element involves resolving the type of the
// element's tag name, so we exclude that here to avoid circularities.
// If check mode has `CheckMode.RestBindingElement`, we skip binding pattern contextual types,
// as we want the type of a rest element to be generic when possible.
const contextualType = (isIdentifier(node) || isPropertyAccessExpression(node) || isElementAccessExpression(node)) &&
!((isJsxOpeningElement(node.parent) || isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) &&
getContextualType(node, ContextFlags.SkipBindingPatterns);
(checkMode && checkMode & CheckMode.RestBindingElement ?
getContextualType(node, ContextFlags.SkipBindingPatterns)
: getContextualType(node));
return contextualType && !isGenericType(contextualType);
}
@@ -24979,7 +25076,7 @@ namespace ts {
// 'string | undefined' to give control flow analysis the opportunity to narrow to type 'string'.
const substituteConstraints = !(checkMode && checkMode & CheckMode.Inferential) &&
someType(type, isGenericTypeWithUnionConstraint) &&
(isConstraintPosition(type, reference) || hasNonBindingPatternContextualTypeWithNoGenericTypes(reference));
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
return substituteConstraints ? mapType(type, t => t.flags & TypeFlags.Instantiable && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t) : type;
}
@@ -25051,7 +25148,7 @@ namespace ts {
const links = getNodeLinks(location);
if (!(links.flags & NodeCheckFlags.InCheckIdentifier)) {
links.flags |= NodeCheckFlags.InCheckIdentifier;
const parentType = getTypeForBindingElementParent(parent);
const parentType = getTypeForBindingElementParent(parent, CheckMode.Normal);
links.flags &= ~NodeCheckFlags.InCheckIdentifier;
if (parentType && parentType.flags & TypeFlags.Union && !(parent.kind === SyntaxKind.Parameter && isSymbolAssigned(symbol))) {
const pattern = declaration.parent;
@@ -25988,7 +26085,7 @@ namespace ts {
const parent = declaration.parent.parent;
const name = declaration.propertyName || declaration.name;
const parentType = getContextualTypeForVariableLikeDeclaration(parent) ||
parent.kind !== SyntaxKind.BindingElement && parent.initializer && checkDeclarationInitializer(parent);
parent.kind !== SyntaxKind.BindingElement && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ? CheckMode.RestBindingElement : CheckMode.Normal);
if (!parentType || isBindingPattern(name) || isComputedNonLiteralName(name)) return undefined;
if (parent.name.kind === SyntaxKind.ArrayBindingPattern) {
const index = indexOfNode(declaration.parent.elements, declaration);
@@ -28418,29 +28515,6 @@ namespace ts {
grammarErrorOnNode(right, Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable, idText(right));
}
if (lexicallyScopedSymbol?.valueDeclaration && (getEmitScriptTarget(compilerOptions) === ScriptTarget.ESNext && !useDefineForClassFields)) {
const lexicalClass = getContainingClass(lexicallyScopedSymbol.valueDeclaration);
const parentStaticFieldInitializer = findAncestor(node, (n) => {
if (n === lexicalClass) return "quit";
if (isPropertyDeclaration(n.parent) && hasStaticModifier(n.parent) && n.parent.initializer === n && n.parent.parent === lexicalClass) {
return true;
}
return false;
});
if (parentStaticFieldInitializer) {
const parentStaticFieldInitializerSymbol = getSymbolOfNode(parentStaticFieldInitializer.parent);
Debug.assert(parentStaticFieldInitializerSymbol, "Initializer without declaration symbol");
const diagnostic = error(node,
Diagnostics.Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnext_and_useDefineForClassFields_is_false,
symbolName(lexicallyScopedSymbol));
addRelatedInfo(diagnostic,
createDiagnosticForNode(parentStaticFieldInitializer.parent,
Diagnostics.Initializer_for_property_0,
symbolName(parentStaticFieldInitializerSymbol))
);
}
}
if (isAnyLike) {
if (lexicallyScopedSymbol) {
return isErrorType(apparentType) ? errorType : apparentType;
@@ -28525,7 +28599,7 @@ namespace ts {
return errorType;
}
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getSetAccessorTypeOfSymbol(prop) : getTypeOfSymbol(prop);
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
}
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
@@ -31771,7 +31845,7 @@ namespace ts {
const links = getSymbolLinks(parameter);
if (!links.type) {
const declaration = parameter.valueDeclaration as ParameterDeclaration;
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ true);
links.type = type || getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true);
if (declaration.name.kind !== SyntaxKind.Identifier) {
// if inference didn't come up with anything but unknown, fall back to the binding pattern if present.
if (links.type === unknownType) {
@@ -33688,11 +33762,11 @@ namespace ts {
}
function checkExpressionCached(node: Expression | QualifiedName, checkMode?: CheckMode): Type {
if (checkMode && checkMode !== CheckMode.Normal) {
return checkExpression(node, checkMode);
}
const links = getNodeLinks(node);
if (!links.resolvedType) {
if (checkMode && checkMode !== CheckMode.Normal) {
return checkExpression(node, checkMode);
}
// When computing a type that we're going to cache, we need to ignore any ongoing control flow
// analysis because variables may have transient types in indeterminable states. Moving flowLoopStart
// to the top of the stack ensures all transient types are computed from a known point.
@@ -33714,10 +33788,16 @@ namespace ts {
isJSDocTypeAssertion(node);
}
function checkDeclarationInitializer(declaration: HasExpressionInitializer, contextualType?: Type | undefined) {
function checkDeclarationInitializer(
declaration: HasExpressionInitializer,
checkMode: CheckMode,
contextualType?: Type | undefined
) {
const initializer = getEffectiveInitializer(declaration)!;
const type = getQuickTypeOfExpression(initializer) ||
(contextualType ? checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, CheckMode.Normal) : checkExpressionCached(initializer));
(contextualType ?
checkExpressionWithContextualType(initializer, contextualType, /*inferenceContext*/ undefined, checkMode || CheckMode.Normal)
: checkExpressionCached(initializer, checkMode));
return isParameter(declaration) && declaration.name.kind === SyntaxKind.ArrayBindingPattern &&
isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ?
padTupleType(type, declaration.name) : type;
@@ -34411,6 +34491,7 @@ namespace ts {
}
checkTypeParameters(getEffectiveTypeParameterDeclarations(node));
checkUnmatchedJSDocParameters(node);
forEach(node.parameters, checkParameter);
@@ -34649,9 +34730,7 @@ namespace ts {
checkVariableLikeDeclaration(node);
setNodeLinksForPrivateIdentifierScope(node);
if (isPrivateIdentifier(node.name) && hasStaticModifier(node) && node.initializer && languageVersion === ScriptTarget.ESNext && !compilerOptions.useDefineForClassFields) {
error(node.initializer, Diagnostics.Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_not_specified_with_a_target_of_esnext_Consider_adding_the_useDefineForClassFields_flag);
}
// property signatures already report "initializer not allowed in ambient context" elsewhere
if (hasSyntacticModifier(node, ModifierFlags.Abstract) && node.kind === SyntaxKind.PropertyDeclaration && node.initializer) {
error(node, Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, declarationNameToString(node.name));
@@ -36167,40 +36246,7 @@ namespace ts {
function checkJSDocParameterTag(node: JSDocParameterTag) {
checkSourceElement(node.typeExpression);
if (!getParameterSymbolFromJSDoc(node)) {
const decl = getHostSignatureFromJSDoc(node);
// don't issue an error for invalid hosts -- just functions --
// and give a better error message when the host function mentions `arguments`
// but the tag doesn't have an array type
if (decl) {
const i = getJSDocTags(decl).filter(isJSDocParameterTag).indexOf(node);
if (i > -1 && i < decl.parameters.length && isBindingPattern(decl.parameters[i].name)) {
return;
}
if (!containsArgumentsReference(decl)) {
if (isQualifiedName(node.name)) {
error(node.name,
Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1,
entityNameToString(node.name),
entityNameToString(node.name.left));
}
else {
error(node.name,
Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name,
idText(node.name));
}
}
else if (findLast(getJSDocTags(decl), isJSDocParameterTag) === node &&
node.typeExpression && node.typeExpression.type &&
!isArrayType(getTypeFromTypeNode(node.typeExpression.type))) {
error(node.name,
Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type,
idText(node.name.kind === SyntaxKind.QualifiedName ? node.name.right : node.name));
}
}
}
}
function checkJSDocPropertyTag(node: JSDocPropertyTag) {
checkSourceElement(node.typeExpression);
}
@@ -36968,7 +37014,8 @@ namespace ts {
// check private/protected variable access
const parent = node.parent.parent;
const parentType = getTypeForBindingElementParent(parent);
const parentCheckMode = node.dotDotDotToken ? CheckMode.RestBindingElement : CheckMode.Normal;
const parentType = getTypeForBindingElementParent(parent, parentCheckMode);
const name = node.propertyName || node.name;
if (parentType && !isBindingPattern(name)) {
const exprType = getLiteralTypeFromPropertyName(name);
@@ -38366,7 +38413,7 @@ namespace ts {
const declaration = catchClause.variableDeclaration;
const typeNode = getEffectiveTypeAnnotationNode(getRootDeclaration(declaration));
if (typeNode) {
const type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false);
const type = getTypeForVariableLikeDeclaration(declaration, /*includeOptionality*/ false, CheckMode.Normal);
if (type && !(type.flags & TypeFlags.AnyOrUnknown)) {
grammarErrorOnFirstToken(typeNode, Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);
}
@@ -38495,6 +38542,45 @@ namespace ts {
}
}
function checkUnmatchedJSDocParameters(node: SignatureDeclaration) {
const jsdocParameters = filter(getJSDocTags(node), isJSDocParameterTag);
if (!length(jsdocParameters)) return;
const isJs = isInJSFile(node);
const parameters = new Set<__String>();
const excludedParameters = new Set<number>();
forEach(node.parameters, ({ name }, index) => {
if (isIdentifier(name)) {
parameters.add(name.escapedText);
}
if (isBindingPattern(name)) {
excludedParameters.add(index);
}
});
const containsArguments = containsArgumentsReference(node);
if (containsArguments) {
const lastJSDocParam = lastOrUndefined(jsdocParameters);
if (lastJSDocParam && isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
errorOrSuggestion(isJs, lastJSDocParam.name, Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, idText(lastJSDocParam.name));
}
}
else {
forEach(jsdocParameters, ({ name }, index) => {
if (excludedParameters.has(index) || isIdentifier(name) && parameters.has(name.escapedText)) {
return;
}
if (isQualifiedName(name)) {
errorOrSuggestion(isJs, name, Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, entityNameToString(name), entityNameToString(name.left));
}
else {
errorOrSuggestion(isJs, name, Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, idText(name));
}
});
}
}
/**
* Check each type parameter and check that type parameters have no duplicate type parameter declarations
*/
@@ -39618,7 +39704,7 @@ namespace ts {
const isAmbientExternalModule: boolean = isAmbientModule(node);
const contextErrorMessage = isAmbientExternalModule
? Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file
: Diagnostics.A_namespace_declaration_is_only_allowed_in_a_namespace_or_module;
: Diagnostics.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module;
if (checkGrammarModuleElementContext(node, contextErrorMessage)) {
// If we hit a module declaration in an illegal context, just bail out to avoid cascading errors.
return;
@@ -39864,6 +39950,9 @@ namespace ts {
name
);
}
if (isType && node.kind === SyntaxKind.ImportEqualsDeclaration && hasEffectiveModifier(node, ModifierFlags.Export)) {
error(node, Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided);
}
break;
}
case SyntaxKind.ExportSpecifier: {
@@ -39956,7 +40045,7 @@ namespace ts {
}
function checkImportDeclaration(node: ImportDeclaration) {
if (checkGrammarModuleElementContext(node, Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {
if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
// If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.
return;
}
@@ -39990,7 +40079,7 @@ namespace ts {
}
function checkImportEqualsDeclaration(node: ImportEqualsDeclaration) {
if (checkGrammarModuleElementContext(node, Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module)) {
if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
// If we hit an import declaration in an illegal context, just bail out to avoid cascading errors.
return;
}
@@ -40029,7 +40118,7 @@ namespace ts {
}
function checkExportDeclaration(node: ExportDeclaration) {
if (checkGrammarModuleElementContext(node, Diagnostics.An_export_declaration_can_only_be_used_in_a_module)) {
if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
// If we hit an export in an illegal context, just bail out to avoid cascading errors.
return;
}
@@ -41397,7 +41486,7 @@ namespace ts {
}
if (isBindingPattern(node)) {
return getTypeForVariableLikeDeclaration(node.parent, /*includeOptionality*/ true) || errorType;
return getTypeForVariableLikeDeclaration(node.parent, /*includeOptionality*/ true, CheckMode.Normal) || errorType;
}
if (isInRightSideOfImportOrExportAssignment(node as Identifier)) {
+4 -4
View File
@@ -1252,11 +1252,11 @@ namespace ts {
return result;
}
export function getOwnValues<T>(sparseArray: T[]): T[] {
export function getOwnValues<T>(collection: MapLike<T> | T[]): T[] {
const values: T[] = [];
for (const key in sparseArray) {
if (hasOwnProperty.call(sparseArray, key)) {
values.push(sparseArray[key]);
for (const key in collection) {
if (hasOwnProperty.call(collection, key)) {
values.push((collection as MapLike<T>)[key]);
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
namespace ts {
// WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
// If changing the text in this section, be sure to test `configurePrerelease` too.
export const versionMajorMinor = "4.6";
export const versionMajorMinor = "4.7";
// The following is baselined as a literal template type without intervention
/** The version of the TypeScript compiler release */
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
+33 -13
View File
@@ -727,11 +727,11 @@
"category": "Error",
"code": 1231
},
"An import declaration can only be used in a namespace or module.": {
"An import declaration can only be used at the top level of a namespace or module.": {
"category": "Error",
"code": 1232
},
"An export declaration can only be used in a module.": {
"An export declaration can only be used at the top level of a namespace or module.": {
"category": "Error",
"code": 1233
},
@@ -739,7 +739,7 @@
"category": "Error",
"code": 1234
},
"A namespace declaration is only allowed in a namespace or module.": {
"A namespace declaration is only allowed at the top level of a namespace or module.": {
"category": "Error",
"code": 1235
},
@@ -867,14 +867,18 @@
"category": "Error",
"code": 1268
},
"Decorator function return type '{0}' is not assignable to type '{1}'.": {
"Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.": {
"category": "Error",
"code": 1269
},
"Decorator function return type is '{0}' but is expected to be 'void' or 'any'.": {
"Decorator function return type '{0}' is not assignable to type '{1}'.": {
"category": "Error",
"code": 1270
},
"Decorator function return type is '{0}' but is expected to be 'void' or 'any'.": {
"category": "Error",
"code": 1271
},
"'with' statements are not allowed in an async function block.": {
"category": "Error",
@@ -1421,6 +1425,14 @@
"category": "Error",
"code": 1472
},
"An import declaration can only be used at the top level of a module.": {
"category": "Error",
"code": 1473
},
"An export declaration can only be used at the top level of a module.": {
"category": "Error",
"code": 1474
},
"The types of '{0}' are incompatible between these types.": {
"category": "Error",
@@ -3289,10 +3301,6 @@
"category": "Error",
"code": 2804
},
"Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.": {
"category": "Error",
"code": 2805
},
"Private accessor was defined without a getter.": {
"category": "Error",
"code": 2806
@@ -3309,10 +3317,6 @@
"category": "Error",
"code": 2809
},
"Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.": {
"category": "Error",
"code": 2810
},
"Initializer for property '{0}'": {
"category": "Error",
"code": 2811
@@ -7139,6 +7143,22 @@
"category": "Message",
"code": 95169
},
"Convert named imports to default import": {
"category": "Message",
"code": 95170
},
"Delete unused '@param' tag '{0}'": {
"category": "Message",
"code": 95171
},
"Delete all unused '@param' tags": {
"category": "Message",
"code": 95172
},
"Rename '@param' tag name '{0}' to '{1}'": {
"category": "Message",
"code": 95173
},
"No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer.": {
"category": "Error",
+1 -1
View File
@@ -127,7 +127,7 @@ namespace ts {
/**
* Gets a custom text range to use when emitting comments.
*/
export function getCommentRange(node: Node) {
export function getCommentRange(node: Node): TextRange {
return node.emitNode?.commentRange ?? node;
}
+45 -5
View File
@@ -417,7 +417,7 @@ namespace ts {
result = searchResult && searchResult.value;
}
else {
const { path: candidate } = normalizePathAndParts(combinePaths(initialLocationForSecondaryLookup, typeReferenceDirectiveName));
const { path: candidate } = normalizePathForCJSResolution(initialLocationForSecondaryLookup, typeReferenceDirectiveName);
result = nodeLoadModuleByRelativeName(Extensions.DtsOnly, candidate, /*onlyRecordFailures*/ false, moduleResolutionState, /*considerPackageJson*/ true);
}
return resolvedTypeScriptOnly(result);
@@ -1329,12 +1329,26 @@ namespace ts {
return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } };
}
else {
const { path: candidate, parts } = normalizePathAndParts(combinePaths(containingDirectory, moduleName));
const { path: candidate, parts } = normalizePathForCJSResolution(containingDirectory, moduleName);
const resolved = nodeLoadModuleByRelativeName(extensions, candidate, /*onlyRecordFailures*/ false, state, /*considerPackageJson*/ true);
// Treat explicit "node_modules" import as an external library import.
return resolved && toSearchResult({ resolved, isExternalLibraryImport: contains(parts, "node_modules") });
}
}
}
// If you import from "." inside a containing directory "/foo", the result of `normalizePath`
// would be "/foo", but this loses the information that `foo` is a directory and we intended
// to look inside of it. The Node CommonJS resolution algorithm doesn't call this out
// (https://nodejs.org/api/modules.html#all-together), but it seems that module paths ending
// in `.` are actually normalized to `./` before proceeding with the resolution algorithm.
function normalizePathForCJSResolution(containingDirectory: string, moduleName: string) {
const combined = combinePaths(containingDirectory, moduleName);
const parts = getPathComponents(combined);
const lastPart = lastOrUndefined(parts);
const path = lastPart === "." || lastPart === ".." ? ensureTrailingDirectorySeparator(normalizePath(combined)) : normalizePath(combined);
return { path, parts };
}
function realPath(path: string, host: ModuleResolutionHost, traceEnabled: boolean): string {
@@ -1380,7 +1394,13 @@ namespace ts {
onlyRecordFailures = true;
}
}
return loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson);
// esm mode relative imports shouldn't do any directory lookups (either inside `package.json`
// files or implicit `index.js`es). This is a notable depature from cjs norms, where `./foo/pkg`
// could have been redirected by `./foo/pkg/package.json` to an arbitrary location!
if (!(state.features & NodeResolutionFeatures.EsmMode)) {
return loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson);
}
return undefined;
}
/*@internal*/
@@ -1799,7 +1819,17 @@ namespace ts {
// Even if extensions is DtsOnly, we can still look up a .ts file as a result of package.json "types"
const nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions;
// Don't do package.json lookup recursively, because Node.js' package lookup doesn't.
return nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false);
// Disable `EsmMode` for the resolution of the package path for cjs-mode packages (so the `main` field can omit extensions)
// (technically it only emits a deprecation warning in esm packages right now, but that's probably
// enough to mean we don't need to support it)
const features = state.features;
if (jsonContent?.type !== "module") {
state.features &= ~NodeResolutionFeatures.EsmMode;
}
const result = nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, /*considerPackageJson*/ false);
state.features = features;
return result;
};
const onlyRecordFailuresForPackageFile = packageFile ? !directoryProbablyExists(getDirectoryPath(packageFile), state.host) : undefined;
@@ -2164,7 +2194,7 @@ namespace ts {
if (packageInfo && packageInfo.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
return loadModuleFromExports(packageInfo, extensions, combinePaths(".", rest), state, cache, redirectedReference)?.value;
}
const pathAndExtension =
let pathAndExtension =
loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
loadNodeModuleFromDirectoryWorker(
extensions,
@@ -2174,6 +2204,16 @@ namespace ts {
packageInfo && packageInfo.packageJsonContent,
packageInfo && packageInfo.versionPaths
);
if (
!pathAndExtension && packageInfo
&& packageInfo.packageJsonContent.exports === undefined
&& packageInfo.packageJsonContent.main === undefined
&& state.features & NodeResolutionFeatures.EsmMode
) {
// EsmMode disables index lookup in `loadNodeModuleFromDirectoryWorker` generally, however non-relative package resolutions still assume
// a default `index.js` entrypoint if no `main` or `exports` are present
pathAndExtension = loadModuleFromFile(extensions, combinePaths(candidate, "index.js"), onlyRecordFailures, state);
}
return withPackageId(packageInfo, pathAndExtension);
};
-12
View File
@@ -585,18 +585,6 @@ namespace ts {
return getCanonicalFileName(nonCanonicalizedPath) as Path;
}
export function normalizePathAndParts(path: string): { path: string, parts: string[] } {
path = normalizeSlashes(path);
const [root, ...parts] = reducePathComponents(getPathComponents(path));
if (parts.length) {
const joinedParts = root + parts.join(directorySeparator);
return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts };
}
else {
return { path: root, parts };
}
}
//// Path Mutation
/**
+3 -3
View File
@@ -861,9 +861,9 @@ namespace ts {
Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code,
Diagnostics.An_export_declaration_cannot_have_modifiers.code,
Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code,
Diagnostics.An_import_declaration_cannot_have_modifiers.code,
Diagnostics.An_object_member_cannot_be_declared_optional.code,
Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
@@ -2102,7 +2102,7 @@ namespace ts {
const isJs = sourceFile.scriptKind === ScriptKind.JS || sourceFile.scriptKind === ScriptKind.JSX;
const isCheckJs = isJs && isCheckJsEnabledForFile(sourceFile, options);
const isPlainJs = isJs && !sourceFile.checkJsDirective && options.checkJs === undefined;
const isPlainJs = isPlainJsFile(sourceFile, options.checkJs);
const isTsNoCheck = !!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false;
// By default, only type-check .ts, .tsx, Deferred, plain JS, checked JS and External
+78 -20
View File
@@ -135,10 +135,13 @@ namespace ts {
const shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < ScriptTarget.ES2022;
// We need to transform `this` in a static initializer into a reference to the class
// when targeting < ES2022 since the assignment will be moved outside of the class body.
const shouldTransformThisInStaticInitializers = languageVersion < ScriptTarget.ES2022;
// We don't need to transform `super` property access when targeting ES5, ES3 because
// the es2015 transformation handles those.
const shouldTransformSuperInStaticInitializers = (languageVersion <= ScriptTarget.ES2021 || !useDefineForClassFields) && languageVersion >= ScriptTarget.ES2015;
const shouldTransformThisInStaticInitializers = languageVersion <= ScriptTarget.ES2021 || !useDefineForClassFields;
const shouldTransformSuperInStaticInitializers = shouldTransformThisInStaticInitializers && languageVersion >= ScriptTarget.ES2015;
const previousOnSubstituteNode = context.onSubstituteNode;
context.onSubstituteNode = onSubstituteNode;
@@ -422,6 +425,11 @@ namespace ts {
if (isPrivateIdentifier(node.name)) {
if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
if (isStatic(node)) {
// static fields are left as is
return visitEachChild(node, visitor, context);
}
// Initializer is elided as the field is initialized in transformConstructor.
return factory.updatePropertyDeclaration(
node,
@@ -448,6 +456,28 @@ namespace ts {
if (expr && !isSimpleInlineableExpression(expr)) {
getPendingExpressions().push(expr);
}
if (isStatic(node) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) {
const initializerStatement = transformPropertyOrClassStaticBlock(node, factory.createThis());
if (initializerStatement) {
const staticBlock = factory.createClassStaticBlockDeclaration(
/*decorators*/ undefined,
/*modifiers*/ undefined,
factory.createBlock([initializerStatement])
);
setOriginalNode(staticBlock, node);
setCommentRange(staticBlock, node);
// Set the comment range for the statement to an empty synthetic range
// and drop synthetic comments from the statement to avoid printing them twice.
setCommentRange(initializerStatement, { pos: -1, end: -1 });
setSyntheticLeadingComments(initializerStatement, undefined);
setSyntheticTrailingComments(initializerStatement, undefined);
return staticBlock;
}
}
return undefined;
}
@@ -1006,8 +1036,6 @@ namespace ts {
enableSubstitutionForClassStaticThisOrSuperReference();
}
const staticProperties = getStaticPropertiesAndClassStaticBlock(node);
// If a class has private static fields, or a static field has a `this` or `super` reference,
// then we need to allocate a temp variable to hold on to that reference.
let pendingClassReferenceAssignment: BinaryExpression | undefined;
@@ -1047,6 +1075,7 @@ namespace ts {
// HasLexicalDeclaration (N) : Determines if the argument identifier has a binding in this environment record that was created using
// a lexical declaration such as a LexicalDeclaration or a ClassDeclaration.
const staticProperties = getStaticPropertiesAndClassStaticBlock(node);
if (some(staticProperties)) {
addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory.getInternalName(node));
}
@@ -1102,7 +1131,7 @@ namespace ts {
transformClassMembers(node, isDerivedClass)
);
const hasTransformableStatics = some(staticPropertiesOrClassStaticBlocks, p => isClassStaticBlockDeclaration(p) || !!p.initializer || (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifier(p.name)));
const hasTransformableStatics = shouldTransformPrivateElementsOrClassStaticBlocks && some(staticPropertiesOrClassStaticBlocks, p => isClassStaticBlockDeclaration(p) || !!p.initializer || isPrivateIdentifier(p.name));
if (hasTransformableStatics || some(pendingExpressions)) {
if (isDecoratedClassDeclaration) {
Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration.");
@@ -1156,6 +1185,7 @@ namespace ts {
}
function transformClassMembers(node: ClassDeclaration | ClassExpression, isDerivedClass: boolean) {
const members: ClassElement[] = [];
if (shouldTransformPrivateElementsOrClassStaticBlocks) {
// Declare private names.
for (const member of node.members) {
@@ -1169,12 +1199,26 @@ namespace ts {
}
}
const members: ClassElement[] = [];
const constructor = transformConstructor(node, isDerivedClass);
const visitedMembers = visitNodes(node.members, classElementVisitor, isClassElement);
if (constructor) {
members.push(constructor);
}
addRange(members, visitNodes(node.members, classElementVisitor, isClassElement));
if (!shouldTransformPrivateElementsOrClassStaticBlocks && some(pendingExpressions)) {
members.push(factory.createClassStaticBlockDeclaration(
/*decorators*/ undefined,
/*modifiers*/ undefined,
factory.createBlock([
factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))
])
));
pendingExpressions = undefined;
}
addRange(members, visitedMembers);
return setTextRange(factory.createNodeArray(members), /*location*/ node.members);
}
@@ -1374,27 +1418,41 @@ namespace ts {
*/
function addPropertyOrClassStaticBlockStatements(statements: Statement[], properties: readonly (PropertyDeclaration | ClassStaticBlockDeclaration)[], receiver: LeftHandSideExpression) {
for (const property of properties) {
const expression = isClassStaticBlockDeclaration(property) ?
transformClassStaticBlockDeclaration(property) :
transformProperty(property, receiver);
if (!expression) {
if (isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) {
continue;
}
const statement = factory.createExpressionStatement(expression);
setSourceMapRange(statement, moveRangePastModifiers(property));
setCommentRange(statement, property);
setOriginalNode(statement, property);
// `setOriginalNode` *copies* the `emitNode` from `property`, so now both
// `statement` and `expression` have a copy of the synthesized comments.
// Drop the comments from expression to avoid printing them twice.
setSyntheticLeadingComments(expression, undefined);
setSyntheticTrailingComments(expression, undefined);
const statement = transformPropertyOrClassStaticBlock(property, receiver);
if (!statement) {
continue;
}
statements.push(statement);
}
}
function transformPropertyOrClassStaticBlock(property: PropertyDeclaration | ClassStaticBlockDeclaration, receiver: LeftHandSideExpression) {
const expression = isClassStaticBlockDeclaration(property) ?
transformClassStaticBlockDeclaration(property) :
transformProperty(property, receiver);
if (!expression) {
return undefined;
}
const statement = factory.createExpressionStatement(expression);
setSourceMapRange(statement, moveRangePastModifiers(property));
setCommentRange(statement, property);
setOriginalNode(statement, property);
// `setOriginalNode` *copies* the `emitNode` from `property`, so now both
// `statement` and `expression` have a copy of the synthesized comments.
// Drop the comments from expression to avoid printing them twice.
setSyntheticLeadingComments(expression, undefined);
setSyntheticTrailingComments(expression, undefined);
return statement;
}
/**
* Generates assignment expressions for property initializers.
*
+1
View File
@@ -4952,6 +4952,7 @@ namespace ts {
extendedContainersByFile?: ESMap<NodeId, Symbol[]>; // Containers (other than the parent) which this symbol is aliased in
variances?: VarianceFlags[]; // Alias symbol type argument variance cache
deferralConstituents?: Type[]; // Calculated list of constituents for a deferred type
deferralWriteConstituents?: Type[]; // Constituents of a deferred `writeType`
deferralParent?: Type; // Source union/intersection of a deferred type
cjsExportMerged?: Symbol; // Version of the symbol with all non export= exports merged with the export= target
typeOnlyDeclaration?: TypeOnlyAliasDeclaration | false; // First resolved alias declaration that makes the symbol only usable in type constructs
+9 -1
View File
@@ -20,6 +20,10 @@ namespace ts {
return undefined;
}
export function getDeclarationsOfKind<T extends Declaration>(symbol: Symbol, kind: T["kind"]): T[] {
return filter(symbol.declarations || emptyArray, d => d.kind === kind) as T[];
}
export function createSymbolTable(symbols?: readonly Symbol[]): SymbolTable {
const result = new Map<__String, Symbol>();
if (symbols) {
@@ -267,6 +271,10 @@ namespace ts {
return getSourceFileOfNode(module.valueDeclaration || getNonAugmentationDeclaration(module));
}
export function isPlainJsFile(file: SourceFile | undefined, checkJs: boolean | undefined): boolean {
return !!file && (file.scriptKind === ScriptKind.JS || file.scriptKind === ScriptKind.JSX) && !file.checkJsDirective && checkJs === undefined;
}
export function isStatementWithLocals(node: Node) {
switch (node.kind) {
case SyntaxKind.Block:
@@ -2506,7 +2514,7 @@ namespace ts {
return expr.right;
}
export function isPrototypePropertyAssignment(node: Node): boolean {
export function isPrototypePropertyAssignment(node: Node): node is BinaryExpression {
return isBinaryExpression(node) && getAssignmentDeclarationKind(node) === AssignmentDeclarationKind.PrototypeProperty;
}
+10 -3
View File
@@ -905,9 +905,16 @@ namespace ts {
/** Gets the text of a jsdoc comment, flattening links to their text. */
export function getTextOfJSDocComment(comment?: string | NodeArray<JSDocComment>) {
return typeof comment === "string" ? comment
: comment?.map(c =>
// TODO: Other kinds here
c.kind === SyntaxKind.JSDocText ? c.text : `{@link ${c.name ? entityNameToString(c.name) + " " : ""}${c.text}}`).join("");
: comment?.map(c => c.kind === SyntaxKind.JSDocText ? c.text : formatJSDocLink(c)).join("");
}
function formatJSDocLink(link: JSDocLink | JSDocLinkCode | JSDocLinkPlain) {
const kind = link.kind === SyntaxKind.JSDocLink ? "link"
: link.kind === SyntaxKind.JSDocLinkCode ? "linkcode"
: "linkplain";
const name = link.name ? entityNameToString(link.name) : "";
const space = link.name && link.text.startsWith("://") ? "" : " ";
return `{@${kind} ${name}${space}${link.text}}`;
}
/**
+3 -2
View File
@@ -3146,11 +3146,12 @@ namespace FourSlash {
});
}
public verifyImportFixModuleSpecifiers(markerName: string, moduleSpecifiers: string[]) {
public verifyImportFixModuleSpecifiers(markerName: string, moduleSpecifiers: string[], preferences?: ts.UserPreferences) {
const marker = this.getMarkerByName(markerName);
const codeFixes = this.getCodeFixes(marker.fileName, ts.Diagnostics.Cannot_find_name_0.code, {
includeCompletionsForModuleExports: true,
includeCompletionsWithInsertText: true
includeCompletionsWithInsertText: true,
...preferences,
}, marker.position).filter(f => f.fixName === ts.codefix.importFixName);
const actualModuleSpecifiers = ts.mapDefined(codeFixes, fix => {
+2 -2
View File
@@ -478,8 +478,8 @@ namespace FourSlashInterface {
this.state.verifyImportFixAtPosition(expectedTextArray, errorCode, preferences);
}
public importFixModuleSpecifiers(marker: string, moduleSpecifiers: string[]) {
this.state.verifyImportFixModuleSpecifiers(marker, moduleSpecifiers);
public importFixModuleSpecifiers(marker: string, moduleSpecifiers: string[], preferences?: ts.UserPreferences) {
this.state.verifyImportFixModuleSpecifiers(marker, moduleSpecifiers, preferences);
}
public navigationBar(json: any, options?: { checkSpans?: boolean }) {
@@ -537,11 +537,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[只允许命名空间或模块中使用命名空间声明。]]></Val>
<Val><![CDATA[命名空间声明只允许位于命名空间或模块的顶层。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1860,11 +1860,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[导出声明只能在模块使用。]]></Val>
<Val><![CDATA[导出声明只能在模块的顶层使用。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[导出声明只能在命名空间或模块的顶层使用。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1944,11 +1953,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[导入声明只能在命名空间或模块中使用。]]></Val>
<Val><![CDATA[导入声明只能在模块的顶层使用。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[导入声明只能在命名空间或模块的顶层使用。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3210,6 +3228,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[在提供 “--isolatedModules” 标志时,无法在类型或仅类型命名空间上使用“导出导入”。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4041,6 +4068,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[将命名导入转换为默认导入]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4614,6 +4650,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[删除所有未使用的 “@param” 标记]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4623,6 +4668,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[删除未使用的 “@param” 标记“{0}”]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10296,15 +10350,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[当 “target” 为 “esnext” 且 “useDefineForClassFields” 为 ”false” 时,属性“{0}”不能用在同一类静态属性的初始化表达式中。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10854,6 +10899,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[将 “@param” 标记名称“{0}”重命名为“{1}”]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12192,15 +12246,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[若未使用 "esnext" 的 "--target" 指定 "--useDefineForClassFields" 标志,则具有专用名称的静态字段不能有初始值设定项。请考虑添加 "--useDefineForClassFields" 标志。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -537,11 +537,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[只有命名空間或模組才允許命名空間宣告。]]></Val>
<Val><![CDATA[命名空間宣告只允許命名空間或模組的頂層。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1860,11 +1860,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[匯出宣告只可用於模組中。]]></Val>
<Val><![CDATA[匯出宣告只能在模組的頂層使用。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[匯出宣告只能在命名空間或模組的頂層使用。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1944,11 +1953,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[匯入宣告只可用於命名空間或模組中。]]></Val>
<Val><![CDATA[匯入宣告只能在模組的頂層使用。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[匯入宣告只能在命名空間或模組的頂層使用。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3210,6 +3228,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[提供 '--isolatedModules' 旗標時,無法在類型或僅類型命名空間上使用 'export import'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4041,6 +4068,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將具名匯入轉換為預設匯入]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4614,6 +4650,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[刪除所有未使用的 '@param' 標籤]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4623,6 +4668,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[刪除未使用的 '@param' 標記 '{0}']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10296,15 +10350,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[當 'target' 為 'esnext' 且 'useDefineForClassFields' 為 'false' 時,不能在同一個類別的靜態屬性初始設定式中使用屬性 '{0}'。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10854,6 +10899,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[將 '@param' 標籤名稱 '{0}' 重新命名為'{1}']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12192,15 +12246,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[當 '--useDefineForClassFields' 旗標未以 'esnext' 的 '--target' 指定時,具有私人名稱的靜態欄位不得有初始設定式。請考慮新增 '--useDefineForClassFields' 旗標。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -546,11 +546,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarace oboru názvů je povolená jenom v oboru názvů nebo v modulu.]]></Val>
<Val><![CDATA[Deklarace oboru názvů je povolená pouze na nejvyšší úrovni oboru názvů nebo v modulu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1869,11 +1869,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarace exportu jde použít jenom v modulu.]]></Val>
<Val><![CDATA[Deklarace exportu se dá použít pouze na nejvyšší úrovni modulu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarace exportu se dá použít pouze na nejvyšší úrovni oboru názvů nebo modulu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1953,11 +1962,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarace importu jde použít jenom v oboru názvů nebo modulu.]]></Val>
<Val><![CDATA[Deklarace importu se dá použít pouze na nejvyšší úrovni modulu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklarace importu se dá použít pouze na nejvyšší úrovni oboru názvů nebo modulu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3219,6 +3237,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Když se zadá příznak --isolatedModules, nejde pro obor názvů typu nebo obor názvů jen pro typ použít export import.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4050,6 +4077,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Převést pojmenované importy na výchozí import]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4623,6 +4659,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Odstranit všechny nepoužívané značky @param]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4632,6 +4677,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Odstranit nepoužívanou značku @param {0}]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10305,15 +10359,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Vlastnost „{0}“ se nedá použít v inicializátoru statické vlastnosti stejné třídy, když „cíl“ je „esnext“ a „useDefineForClassFields“ je „nepravda“.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10863,6 +10908,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Přejmenovat značku @param {0} na {1}]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12201,15 +12255,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Statická pole s privátními názvy nemůžou mít inicializátory, pokud se nezadá příznak --useDefineForClassFields s parametrem --target o hodnotě esnext. Zvažte možnost přidat příznak --useDefineForClassFields.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -537,11 +537,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eine Namespacedeklaration ist nur in einem Namespace oder Modul zulässig.]]></Val>
<Val><![CDATA[Eine Namespacedeklaration ist nur auf der obersten Ebene eines Namespaces oder Moduls zulässig.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1857,11 +1857,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eine Exportdeklaration kann nur in einem Modul verwendet werden.]]></Val>
<Val><![CDATA[Eine Exportdeklaration kann nur auf der obersten Ebene eines Moduls verwendet werden.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eine Exportdeklaration kann nur auf der obersten Ebene eines Namespace oder Moduls verwendet werden.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1941,11 +1950,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eine Importdeklaration darf nur in einem Namespace oder Modul verwendet werden.]]></Val>
<Val><![CDATA[Eine Importdeklaration kann nur auf der obersten Ebene eines Moduls verwendet werden.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eine Importdeklaration kann nur auf der obersten Ebene eines Namespace oder Moduls verwendet werden.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3207,6 +3225,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[„export import“ kann nicht für einen Typ oder einen reinen Typnamespace verwendet werden, wenn das Flag „--isolatedModules“ angegeben wird.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4038,6 +4065,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Konvertieren benannter Importe in Standardimporte]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4611,6 +4647,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Alle nicht verwendeten "@param"-Tags löschen]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4620,6 +4665,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nicht verwendete "@param"-Tag-"{0}" löschen]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10290,15 +10344,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Die Eigenschaft "{0}" darf nicht im Initialisierer einer statischen Eigenschaft in derselben Klasse verwendet werden, wenn "target" auf "esnext" und "useDefineForClassFields" auf FALSE festgelegt ist.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10848,6 +10893,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Tagnamen "@param" "{0}" in "{1}" umbenennen]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12186,15 +12240,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Statische Felder mit privaten Namen dürfen keine Initialisierer enthalten, wenn das Flag "--useDefineForClassFields" nicht mit dem Wert "esnext" für "--target" angegeben wird. Erwägen Sie, das Flag "--useDefineForClassFields" hinzuzufügen.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -546,11 +546,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una declaración de espacio de nombres solo se permite en un espacio de nombres o en un módulo.]]></Val>
<Val><![CDATA[Una declaración de espacio de nombres solo se permite en el nivel superior de un espacio de nombres o módulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1872,11 +1872,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una declaración de exportación solo se puede usar en un módulo.]]></Val>
<Val><![CDATA[Una declaración de exportación solo se puede usar en el nivel superior de un módulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una declaración de exportación solo se puede usar en el nivel superior de un espacio de nombres o módulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1956,11 +1965,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una declaración de importación solo se puede usar en un espacio de nombres o un módulo.]]></Val>
<Val><![CDATA[Una declaración de importación solo se puede usar en el nivel superior de un módulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una declaración de importación solo se puede usar en el nivel superior de un espacio de nombres o módulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3222,6 +3240,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[No se puede utilizar “exportar importar” en un espacio de nombres de tipo o solo de tipo cuando se proporciona la marca "--isolatedModules".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4053,6 +4080,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Convertir importaciones con nombre en importación predeterminada]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4626,6 +4662,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eliminar todas las etiquetas "@param" sin usar]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4635,6 +4680,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eliminar la etiqueta "@param" sin usar "{0}"]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10308,15 +10362,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La propiedad "{0}" no se puede usar en un inicializador de propiedad estática en la misma clase cuando "target" es "esnext" y "useDefineForClassFields" es "false".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10866,6 +10911,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Cambiar el nombre de la etiqueta "@param" "{0}" a "{1}"]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12204,15 +12258,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Los campos estáticos con nombres privados no pueden tener inicializadores si la marca "--useDefineForClassFields" no se especifica con un valor "--target" de "esnext". Pruebe a agregar la marca "--useDefineForClassFields".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -546,11 +546,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une déclaration d'espace de noms est autorisée uniquement dans un espace de noms ou un module.]]></Val>
<Val><![CDATA[Une déclaration despace de noms nest autorisée quau niveau supérieur dun espace de noms ou dun module.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1872,11 +1872,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une déclaration d'exportation peut uniquement être utilisée dans un module.]]></Val>
<Val><![CDATA[Une déclaration dexportation ne peut être utilisée quau niveau supérieur dun module.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une déclaration dexportation ne peut être utilisée quau niveau supérieur dun espace de noms ou dun module.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1956,11 +1965,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une déclaration d'importation peut uniquement être utilisée dans un espace de noms ou un module.]]></Val>
<Val><![CDATA[Une déclaration dimportation ne peut être utilisée quau niveau supérieur dun module.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Une déclaration dimportation ne peut être utilisée quau niveau supérieur dun espace de noms ou dun module.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3222,6 +3240,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Impossible dutiliser « export import » sur un espace de noms de type ou de type uniquement lorsque lindicateur « --isolatedModules » est fourni.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4053,6 +4080,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Convertir les importations nommées en importation par défaut]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4626,6 +4662,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Supprimer toutes les balises '@param' inutilisées]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4635,6 +4680,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Supprimer la balise '@param' inutilisée '{0}']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10308,15 +10362,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La propriété '{0}' ne peut pas être utilisée dans la version initiale dune propriété statique dans la même classe lorsque 'target' est 'esnext' et 'useDefineForClassFields' est 'false'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10866,6 +10911,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Renommez le nom de balise '@param' '{0}' en '{1}']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12204,15 +12258,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Les champs static avec des noms privés ne peuvent pas avoir d'initialiseurs quand l'indicateur '--useDefineForClassFields' n'est pas spécifié avec le '--target' 'esnext'. Ajoutez l'indicateur '--useDefineForClassFields'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -537,11 +537,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una dichiarazione di spazio dei nomi è consentita solo in uno spazio dei nomi o in un modulo.]]></Val>
<Val><![CDATA[Una dichiarazione di spazio dei nomi è consentita solo al livello superiore di uno spazio dei nomi o di un modulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1860,11 +1860,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[È possibile usare una dichiarazione di esportazione solo in un modulo.]]></Val>
<Val><![CDATA[Una dichiarazione di esportazione può essere usata solo al livello superiore di un modulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una dichiarazione di esportazione può essere usata solo al livello superiore di uno spazio dei nomi o di un modulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1944,11 +1953,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[È possibile usare una dichiarazione di importazione solo in uno spazio dei nomi o in un modulo.]]></Val>
<Val><![CDATA[Una dichiarazione di importazione può essere usata solo al livello superiore di un modulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Una dichiarazione di importazione può essere usata solo al livello superiore di uno spazio dei nomi o di un modulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3210,6 +3228,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Non è possibile usare 'export import' in un tipo o in uno spazio dei nomi solo di tipo quando si specifica il flag '--isolatedModules'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4041,6 +4068,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Converti importazioni denominate nell'importazione predefinita]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4614,6 +4650,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eliminare tutti i tag '@param' inutilizzati]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4623,6 +4668,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Eliminare il tag '@param' '{0}' inutilizzato]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10296,15 +10350,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[La proprietà '{0}' potrebbe non essere usata in un inizializzatore di proprietà statica nella stessa classe quando 'target' è 'esnext' e 'useDefineForClassFields' è 'false'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10854,6 +10899,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Cambiane il nome '{0}' del tag '@param' in '{1}']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12192,15 +12246,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[I campi statici con nomi privati non possono includere inizializzatori quando per specificare il flag '--useDefineForClassFields' non si usa '--target' con valore 'esnext'. Provare ad aggiungere il flag '--useDefineForClassFields'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -537,11 +537,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[名前空間宣言は、名前空間モジュールでのみ使用できます。]]></Val>
<Val><![CDATA[名前空間宣言は、名前空間またはモジュールの最上位レベルでのみ許可されます。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1860,11 +1860,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[エクスポート宣言はモジュールでのみ使用可能です。]]></Val>
<Val><![CDATA[エクスポート宣言はモジュールの最上位レベルでのみ使用できます。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[エクスポート宣言は、名前空間またはモジュールの最上位レベルでのみ使用できます。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1944,11 +1953,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[インポート宣言は名前空間またはモジュールでのみ使用可能です。]]></Val>
<Val><![CDATA[インポート宣言は、モジュールの最上位レベルでのみ使用できます。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[インポート宣言は、名前空間またはモジュールの最上位レベルでのみ使用できます。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3210,6 +3228,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['--isolatedModules' フラグが指定されている場合、型または型専用の名前空間で 'export import' を使用することはできません。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4041,6 +4068,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[名前付きインポートを既定のインポートに変換する]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4614,6 +4650,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[未使用の '@param' タグをすべて削除します]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4623,6 +4668,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[未使用の '@param' タグ '{0}' を削除します]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10296,15 +10350,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[' target ' が ' esnext ' で、' useesb Forclassfields ' が ' false ' の場合、プロパティ ' {0} ' を同じクラスにある静的プロパティの初期化子で使用することはできません。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10854,6 +10899,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['@param' タグ名の名前を '{0}' から '{1}' に変更します]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12192,15 +12246,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['--useDefineForClassFields' フラグに 'esnext' の '--target' が指定されていない場合、プライベート名を持つ静的フィールドに初期化子を指定することはできません。'--useDefineForClassFields' フラグを追加することをご検討ください。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -537,11 +537,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[네임스페이스 선언은 네임스페이스 또는 모듈에서만 사용할 수 있습니다.]]></Val>
<Val><![CDATA[네임스페이스 선언은 네임스페이스 또는 모듈의 최상위 수준에서만 허용됩니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1860,11 +1860,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[내보내기 선언은 모듈에서만 사용할 수 있습니다.]]></Val>
<Val><![CDATA[내보내기 선언은 모듈의 최상위 수준에서만 사용할 수 있습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[내보내기 선언은 네임스페이스 또는 모듈의 최상위 수준에서만 사용할 수 있습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1944,11 +1953,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[내보내기 선언은 네임스페이스 또는 모듈에서만 사용할 수 있습니다.]]></Val>
<Val><![CDATA[가져오기 선언은 모듈의 최상위 수준에서만 사용할 수 있습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[가져오기 선언은 네임스페이스 또는 모듈의 최상위 수준에서만 사용할 수 있습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3210,6 +3228,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['--isolatedModules' 플래그가 제공된 경우 형식 또는 형식 전용 네임스페이스에 '가져오기 내보내기'를 사용할 수 없습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4041,6 +4068,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[명명된 가져오기를 기본 가져오기로 변환]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4614,6 +4650,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[사용하지 않은 '@param' 태그 모두 삭제]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4623,6 +4668,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[사용하지 않는 '@param' 태그 '{0}' 삭제]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10296,15 +10350,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['target'이 'esnext'이고 'useDefineForClassFields'가 'false'인 경우 동일한 클래스의 정적 속성의 이니셜라이저에서 '{0}'(은)는 속성을 사용할 수 없습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10854,6 +10899,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['@param' 태그 이름 '{0}'의 이름을 '{1}'(으)로 바꿉니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12192,15 +12246,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['--useDefineForClassFields' 플래그가 'esnext'의 '--target'과 함께 지정되지 않은 경우 프라이빗 이름을 가진 정적 필드는 이니셜라이저를 포함할 수 없습니다. '--useDefineForClassFields' 플래그를 추가하는 것이 좋습니다.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -530,11 +530,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklaracja przestrzeni nazw jest dozwolona tylko w przestrzeni nazw lub module.]]></Val>
<Val><![CDATA[Deklaracja przestrzeni nazw jest dozwolona tylko na najwyższym poziomie przestrzeni nazw lub modułu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1850,11 +1850,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklaracja eksportu może być używana tylko w module.]]></Val>
<Val><![CDATA[Deklaracji eksportu można używać tylko na najwyższym poziomie modułu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklaracji eksportu można używać tylko na najwyższym poziomie przestrzeni nazw lub modułu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1934,11 +1943,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklaracja importu może być używana tylko w przestrzeni nazw lub module.]]></Val>
<Val><![CDATA[Deklaracji importu można używać tylko na najwyższym poziomie modułu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Deklaracji importu można używać tylko na najwyższym poziomie przestrzeni nazw lub modułu.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3200,6 +3218,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nie można użyć polecenia „export import” w przestrzeni nazw typu lub tylko typu, jeśli podano flagę „--isolatedModules”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4031,6 +4058,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Konwertuj nazwane importy na import domyślny]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4604,6 +4640,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Usuń wszystkie nieużywane tagi „@param”]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4613,6 +4658,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Usuń nieużywany tag „@param” „{0}”]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10283,15 +10337,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nie można użyć właściwości "{0}" w inicjatorze właściwości statycznej w tej samej klasie, gdy parametr "target" ma wartość "esnext", a parametr "useDefineForClassFields" ma wartość "false".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10841,6 +10886,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Zmień nazwę „{0}” tagu „@param” na „{1}”]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12179,15 +12233,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Pola statyczne z nazwami prywatnymi nie mogą mieć inicjatorów, gdy flaga „--useDefineForClassFields” nie jest określona z opcją „--target” o wartości „esnext”. Rozważ dodanie flagi „--useDefineForClassFields”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -530,11 +530,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Uma declaração de namespace só é permitida e um namespace ou módulo.]]></Val>
<Val><![CDATA[Uma declaração de namespace só é permitida no nível superior de um namespace ou módulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1853,11 +1853,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Uma declaração de exportação só pode ser usada em um módulo.]]></Val>
<Val><![CDATA[Uma declaração de exportação só pode ser usada no nível superior de um módulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Uma declaração de exportação só pode ser usada no nível superior de um namespace ou módulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1937,11 +1946,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Uma declaração de importação só pode ser usada em um namespace ou módulo.]]></Val>
<Val><![CDATA[Uma declaração de importação só pode ser usada no nível superior de um módulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Uma declaração de importação só pode ser usada no nível superior de um namespace ou módulo.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3203,6 +3221,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Não é possível usar "exportar importação" em um namespace de tipo ou apenas de tipo quando a bandeira "--isolatedModules" é fornecida.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4034,6 +4061,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Converter importações nomeadas em importação padrão]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4607,6 +4643,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Excluir todas as marcas '@param' não usadas]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4616,6 +4661,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Excluir a marca '@param' não usada '{0}']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10286,15 +10340,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[A propriedade '{0}' não pode ser usada em um inicializador de propriedade estática na mesma classe quando 'target' é 'esnext' e ' useDefineForClassFields' é 'false'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10844,6 +10889,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Renomear o nome da marca '@param' '{0}' como '{1}']]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12182,15 +12236,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Os campos estáticos com nomes privados não podem ter inicializadores quando o sinalizador '--useDefineForClassFields' não está especificado com um '--target' igual a 'esnext'. Considere adicionar o sinalizador '--useDefineForClassFields'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -536,11 +536,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Объявление пространства имен разрешено использовать только в пространстве имен или модуле.]]></Val>
<Val><![CDATA[Объявление пространства имен разрешено только на верхнем уровне пространства имен или модуля.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1859,11 +1859,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Объявление экспорта может быть использовано только в модуле.]]></Val>
<Val><![CDATA[Объявление экспорта может использоваться только на верхнем уровне модуля.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Объявление экспорта может использоваться только на верхнем уровне пространства имен или модуля.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1943,11 +1952,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Объявление импорта может быть использовано только в пространстве имен или модуле.]]></Val>
<Val><![CDATA[Объявление импорта может использоваться только на верхнем уровне модуля.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Объявление импорта может использоваться только на верхнем уровне пространства имен или модуля.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3209,6 +3227,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Невозможно использовать "export import" для типа или пространства имен, доступного только для типов, когда указан флаг "--isolatedModules".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4040,6 +4067,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Преобразовать именованные операции импорта в стандартный импорт]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4613,6 +4649,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Удалить все неиспользуемые теги "@param"]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4622,6 +4667,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Удалить неиспользуемый тег "@param" "{0}"]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10295,15 +10349,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Свойство "{0}" не может использоваться в инициализаторе статического свойства в том же классе, если "target" имеет значение "esnext", а "useDefineForClassFields" — "false".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10853,6 +10898,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Переименовать тег "@param" с "{0}" на "{1}"]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12191,15 +12245,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Статические поля с частными именами не могут иметь инициализаторы, если не указан флаг "--useDefineForClassFields" с параметром "--target", имеющим значение "esnext". Рекомендуется добавить флаг "--useDefineForClassFields".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
@@ -530,11 +530,11 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";A_namespace_declaration_is_only_allowed_in_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[A namespace declaration is only allowed in a namespace or module.]]></Val>
<Val><![CDATA[A namespace declaration is only allowed at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Ad alanı bildirimine yalnızca bir ad alanında veya modülde izin verilir.]]></Val>
<Val><![CDATA[Ad alanı bildirimine yalnızca bir ad alanının veya modülün en üst düzeyinde izin verilir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1853,11 +1853,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_in_a_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used in a module.]]></Val>
<Val><![CDATA[An export declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dışarı aktarma bildirimi yalnızca bir modülde kullanılabilir.]]></Val>
<Val><![CDATA[Dışarı aktarma bildirimi yalnızca modülün en üst düzeyinde kullanılabilir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An export declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Dışarı aktarma bildirimi yalnızca bir ad alanının veya modülün en üst düzeyinde kullanılabilir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1937,11 +1946,20 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_in_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used in a namespace or module.]]></Val>
<Val><![CDATA[An import declaration can only be used at the top level of a module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[İçeri aktarma bildirimi yalnızca bir ad alanında veya modülde kullanılabilir.]]></Val>
<Val><![CDATA[İçeri aktarma bildirimi yalnızca modülün en üst düzeyinde kullanılabilir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[An import declaration can only be used at the top level of a namespace or module.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[İçeri aktarma bildirimi yalnızca bir ad alanının veya modülün en üst düzeyinde kullanılabilir.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -3203,6 +3221,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['--isolatedModules' bayrağı sağlandığında, bir tür veya yalnızca tür ad alanında 'export import' kullanılamaz.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Cannot_use_imports_exports_or_module_augmentations_when_module_is_none_1148" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Cannot use imports, exports, or module augmentations when '--module' is 'none'.]]></Val>
@@ -4034,6 +4061,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_default_import_95170" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to default import]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Adlandırılmış içeri aktarmaları varsayılan içeri aktarmaya dönüştür]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Convert_named_imports_to_namespace_import_95057" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Convert named imports to namespace import]]></Val>
@@ -4607,6 +4643,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_all_unused_param_tags_95172" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete all unused '@param' tags]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Kullanılmayan tüm “@param” etiketlerini silin]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_the_outputs_of_all_projects_6365" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete the outputs of all projects]]></Val>
@@ -4616,6 +4661,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Delete_unused_param_tag_0_95171" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Delete unused '@param' tag '{0}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Kullanılmayan “{0}” “@param” etiket adını silin]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[[Deprecated]5D; Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit]]></Val>
@@ -10289,15 +10343,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['target', 'esnext' ve 'useDefineForClassFields', 'false' olduğunda, '{0}' özelliği aynı sınıftaki bir statik özelliğin başlatıcısında kullanılamaz.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Property_0_may_not_exist_on_type_1_Did_you_mean_2_2568" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Property '{0}' may not exist on type '{1}'. Did you mean '{2}'?]]></Val>
@@ -10847,6 +10892,15 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Rename_param_tag_name_0_to_1_95173" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Rename '@param' tag name '{0}' to '{1}']]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[“{0}” “@param” etiket adını “{1}” olarak yeniden adlandırın]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
@@ -12185,15 +12239,6 @@
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA['--useDefineForClassFields' bayrağı 'esnext' öğesinin '--target' hedefi ile belirtilmediğinde özel adlara sahip statik alanlar başlatıcılara sahip olamaz. '--useDefineForClassFields' bayrağını eklemeyi düşünün.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";Static_members_cannot_reference_class_type_parameters_2302" ItemType="0" PsrId="306" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Static members cannot reference class type parameters.]]></Val>
+4 -1
View File
@@ -370,7 +370,8 @@ namespace ts.server {
function combineProjectOutputForReferences(
projects: Projects,
defaultProject: Project,
initialLocation: DocumentPosition
initialLocation: DocumentPosition,
logger: Logger,
): readonly ReferencedSymbol[] {
const outputs: ReferencedSymbol[] = [];
@@ -379,6 +380,7 @@ namespace ts.server {
defaultProject,
initialLocation,
(project, location, getMappedLocation) => {
logger.info(`Finding references to ${location.fileName} position ${location.pos} in project ${project.getProjectName()}`);
for (const outputReferencedSymbol of project.getLanguageService().findReferences(location.fileName, location.pos) || emptyArray) {
const mappedDefinitionFile = getMappedLocation(project, documentSpanLocation(outputReferencedSymbol.definition));
const definition: ReferencedSymbolDefinitionInfo = mappedDefinitionFile === undefined ?
@@ -1588,6 +1590,7 @@ namespace ts.server {
projects,
this.getDefaultProject(args),
{ fileName: args.file, pos: position },
this.logger,
);
if (!simplifiedResult) return references;
@@ -25,9 +25,12 @@ namespace ts.codefix {
interface Info { readonly indexSignature: IndexSignatureDeclaration; readonly container: FixableDeclaration; }
function getInfo(sourceFile: SourceFile, pos: number): Info | undefined {
const token = getTokenAtPosition(sourceFile, pos);
const indexSignature = cast(token.parent.parent, isIndexSignatureDeclaration);
if (isClassDeclaration(indexSignature.parent)) return undefined;
const container = isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : cast(indexSignature.parent.parent, isTypeAliasDeclaration);
const indexSignature = tryCast(token.parent.parent, isIndexSignatureDeclaration);
if (!indexSignature) return undefined;
const container = isInterfaceDeclaration(indexSignature.parent) ? indexSignature.parent : tryCast(indexSignature.parent.parent, isTypeAliasDeclaration);
if (!container) return undefined;
return { indexSignature, container };
}
@@ -0,0 +1,104 @@
/* @internal */
namespace ts.codefix {
const deleteUnmatchedParameter = "deleteUnmatchedParameter";
const renameUnmatchedParameter = "renameUnmatchedParameter";
const errorCodes = [
Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code,
];
registerCodeFix({
fixIds: [deleteUnmatchedParameter, renameUnmatchedParameter],
errorCodes,
getCodeActions: function getCodeActionsToFixUnmatchedParameter(context) {
const { sourceFile, span } = context;
const actions: CodeFixAction[] = [];
const info = getInfo(sourceFile, span.start);
if (info) {
append(actions, getDeleteAction(context, info));
append(actions, getRenameAction(context, info));
return actions;
}
return undefined;
},
getAllCodeActions: function getAllCodeActionsToFixUnmatchedParameter(context) {
const tagsToSignature = new Map<SignatureDeclaration, JSDocTag[]>();
return createCombinedCodeActions(textChanges.ChangeTracker.with(context, changes => {
eachDiagnostic(context, errorCodes, ({ file, start }) => {
const info = getInfo(file, start);
if (info) {
tagsToSignature.set(info.signature, append(tagsToSignature.get(info.signature), info.jsDocParameterTag));
}
});
tagsToSignature.forEach((tags, signature) => {
if (context.fixId === deleteUnmatchedParameter) {
const tagsSet = new Set(tags);
changes.filterJSDocTags(signature.getSourceFile(), signature, t => !tagsSet.has(t));
}
});
}));
}
});
function getDeleteAction(context: CodeFixContext, { name, signature, jsDocParameterTag }: Info) {
const changes = textChanges.ChangeTracker.with(context, changeTracker =>
changeTracker.filterJSDocTags(context.sourceFile, signature, t => t !== jsDocParameterTag));
return createCodeFixAction(
deleteUnmatchedParameter,
changes,
[Diagnostics.Delete_unused_param_tag_0, name.getText(context.sourceFile)],
deleteUnmatchedParameter,
Diagnostics.Delete_all_unused_param_tags
);
}
function getRenameAction(context: CodeFixContext, { name, signature, jsDocParameterTag }: Info) {
if (!length(signature.parameters)) return undefined;
const sourceFile = context.sourceFile;
const tags = getJSDocTags(signature);
const names = new Set<__String>();
for (const tag of tags) {
if (isJSDocParameterTag(tag) && isIdentifier(tag.name)) {
names.add(tag.name.escapedText);
}
}
// @todo - match to all available names instead to the first parameter name
// @see /codeFixRenameUnmatchedParameter3.ts
const parameterName = firstDefined(signature.parameters, p =>
isIdentifier(p.name) && !names.has(p.name.escapedText) ? p.name.getText(sourceFile) : undefined);
if (parameterName === undefined) return undefined;
const newJSDocParameterTag = factory.updateJSDocParameterTag(
jsDocParameterTag,
jsDocParameterTag.tagName,
factory.createIdentifier(parameterName),
jsDocParameterTag.isBracketed,
jsDocParameterTag.typeExpression,
jsDocParameterTag.isNameFirst,
jsDocParameterTag.comment
);
const changes = textChanges.ChangeTracker.with(context, changeTracker =>
changeTracker.replaceJSDocComment(sourceFile, signature, map(tags, t => t === jsDocParameterTag ? newJSDocParameterTag : t)));
return createCodeFixActionWithoutFixAll(renameUnmatchedParameter, changes, [Diagnostics.Rename_param_tag_name_0_to_1, name.getText(sourceFile), parameterName]);
}
interface Info {
readonly signature: SignatureDeclaration;
readonly jsDocParameterTag: JSDocParameterTag;
readonly name: Identifier;
}
function getInfo(sourceFile: SourceFile, pos: number): Info | undefined {
const token = getTokenAtPosition(sourceFile, pos);
if (token.parent && isJSDocParameterTag(token.parent) && isIdentifier(token.parent.name)) {
const jsDocParameterTag = token.parent;
const signature = getHostSignatureFromJSDoc(jsDocParameterTag);
if (signature) {
return { signature, name: token.parent.name, jsDocParameterTag };
}
}
return undefined;
}
}
@@ -316,6 +316,10 @@ namespace ts.codefix {
// Setter must have a parameter
return false;
case SyntaxKind.GetAccessor:
// Getter cannot have parameters
return true;
default:
return Debug.failBadSyntaxKind(parent);
}
+69 -35
View File
@@ -81,9 +81,9 @@ namespace ts.codefix {
const symbolName = getNameForExportedSymbol(exportedSymbol, getEmitScriptTarget(compilerOptions));
const checker = program.getTypeChecker();
const symbol = checker.getMergedSymbol(skipAlias(exportedSymbol, checker));
const exportInfos = getAllReExportingModules(sourceFile, symbol, moduleSymbol, symbolName, /*isJsxTagName*/ false, host, program, preferences, useAutoImportProvider);
const exportInfo = getAllReExportingModules(sourceFile, symbol, moduleSymbol, symbolName, /*isJsxTagName*/ false, host, program, preferences, useAutoImportProvider);
const useRequire = shouldUseRequire(sourceFile, program);
const fix = getImportFixForSymbol(sourceFile, exportInfos, moduleSymbol, symbolName, program, /*position*/ undefined, !!isValidTypeOnlyUseSite, useRequire, host, preferences);
const fix = getImportFixForSymbol(sourceFile, exportInfo, moduleSymbol, symbolName, program, /*position*/ undefined, !!isValidTypeOnlyUseSite, useRequire, host, preferences);
if (fix) {
addImport({ fixes: [fix], symbolName, errorIdentifierText: undefined });
}
@@ -248,32 +248,35 @@ namespace ts.codefix {
}
type ImportFix = FixUseNamespaceImport | FixAddJsdocTypeImport | FixAddToExistingImport | FixAddNewImport | FixPromoteTypeOnlyImport;
type ImportFixWithModuleSpecifier = FixUseNamespaceImport | FixAddJsdocTypeImport | FixAddToExistingImport | FixAddNewImport;
interface FixUseNamespaceImport {
// Properties are be undefined if fix is derived from an existing import
interface ImportFixBase {
readonly isReExport?: boolean;
readonly exportInfo?: SymbolExportInfo;
readonly moduleSpecifier: string;
}
interface FixUseNamespaceImport extends ImportFixBase {
readonly kind: ImportFixKind.UseNamespace;
readonly namespacePrefix: string;
readonly position: number;
readonly moduleSpecifier: string;
}
interface FixAddJsdocTypeImport {
interface FixAddJsdocTypeImport extends ImportFixBase {
readonly kind: ImportFixKind.JsdocTypeImport;
readonly moduleSpecifier: string;
readonly position: number;
readonly isReExport: boolean;
readonly exportInfo: SymbolExportInfo;
}
interface FixAddToExistingImport {
interface FixAddToExistingImport extends ImportFixBase {
readonly kind: ImportFixKind.AddToExisting;
readonly importClauseOrBindingPattern: ImportClause | ObjectBindingPattern;
readonly moduleSpecifier: string;
readonly importKind: ImportKind.Default | ImportKind.Named;
readonly addAsTypeOnly: AddAsTypeOnly;
}
interface FixAddNewImport {
interface FixAddNewImport extends ImportFixBase {
readonly kind: ImportFixKind.AddNew;
readonly moduleSpecifier: string;
readonly importKind: ImportKind;
readonly addAsTypeOnly: AddAsTypeOnly;
readonly useRequire: boolean;
readonly exportInfo?: SymbolExportInfo;
}
interface FixPromoteTypeOnlyImport {
readonly kind: ImportFixKind.PromoteTypeOnly;
@@ -331,7 +334,7 @@ namespace ts.codefix {
function getImportFixForSymbol(sourceFile: SourceFile, exportInfos: readonly SymbolExportInfo[], moduleSymbol: Symbol, symbolName: string, program: Program, position: number | undefined, isValidTypeOnlyUseSite: boolean, useRequire: boolean, host: LanguageServiceHost, preferences: UserPreferences) {
Debug.assert(exportInfos.some(info => info.moduleSymbol === moduleSymbol || info.symbol.parent === moduleSymbol), "Some exportInfo should match the specified moduleSymbol");
const packageJsonImportFilter = createPackageJsonImportFilter(sourceFile, preferences, host);
return getBestFix(getImportFixes(exportInfos, symbolName, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences), sourceFile, program, packageJsonImportFilter);
return getBestFix(getImportFixes(exportInfos, symbolName, position, isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences), sourceFile, program, packageJsonImportFilter, host);
}
function codeFixActionToCodeAction({ description, changes, commands }: CodeFixAction): CodeAction {
@@ -410,7 +413,7 @@ namespace ts.codefix {
host,
preferences,
fromCacheOnly);
const result = getBestFix(fixes, importingFile, program, packageJsonImportFilter || createPackageJsonImportFilter(importingFile, preferences, host));
const result = getBestFix(fixes, importingFile, program, packageJsonImportFilter || createPackageJsonImportFilter(importingFile, preferences, host), host);
return result && { ...result, computedWithoutCacheCount };
}
@@ -606,7 +609,7 @@ namespace ts.codefix {
position: number | undefined,
isValidTypeOnlyUseSite: boolean,
useRequire: boolean,
moduleSymbols: readonly SymbolExportInfo[],
exportInfo: readonly SymbolExportInfo[],
host: LanguageServiceHost,
preferences: UserPreferences,
fromCacheOnly?: boolean,
@@ -620,7 +623,7 @@ namespace ts.codefix {
: (moduleSymbol: Symbol, checker: TypeChecker) => moduleSpecifiers.getModuleSpecifiersWithCacheInfo(moduleSymbol, checker, compilerOptions, sourceFile, moduleSpecifierResolutionHost, preferences);
let computedWithoutCacheCount = 0;
const fixes = flatMap(moduleSymbols, exportInfo => {
const fixes = flatMap(exportInfo, (exportInfo, i) => {
const checker = getChecker(exportInfo.isFromPackageJson);
const { computedWithoutCache, moduleSpecifiers } = getModuleSpecifiers(exportInfo.moduleSymbol, checker);
const importedSymbolHasValueMeaning = !!(exportInfo.targetFlags & SymbolFlags.Value);
@@ -629,7 +632,7 @@ namespace ts.codefix {
return moduleSpecifiers?.map((moduleSpecifier): FixAddNewImport | FixAddJsdocTypeImport =>
// `position` should only be undefined at a missing jsx namespace, in which case we shouldn't be looking for pure types.
!importedSymbolHasValueMeaning && isJs && position !== undefined
? { kind: ImportFixKind.JsdocTypeImport, moduleSpecifier, position, exportInfo }
? { kind: ImportFixKind.JsdocTypeImport, moduleSpecifier, position, exportInfo, isReExport: i > 0 }
: {
kind: ImportFixKind.AddNew,
moduleSpecifier,
@@ -637,6 +640,7 @@ namespace ts.codefix {
useRequire,
addAsTypeOnly,
exportInfo,
isReExport: i > 0,
}
);
});
@@ -675,7 +679,7 @@ namespace ts.codefix {
}
}
interface FixesInfo { readonly fixes: readonly ImportFix[]; readonly symbolName: string; readonly errorIdentifierText: string | undefined; }
interface FixesInfo { readonly fixes: readonly ImportFix[], readonly symbolName: string, readonly errorIdentifierText: string | undefined }
function getFixesInfo(context: CodeFixContextBase, errorCode: number, pos: number, useAutoImportProvider: boolean): FixesInfo | undefined {
const symbolToken = getTokenAtPosition(context.sourceFile, pos);
let info;
@@ -695,39 +699,73 @@ namespace ts.codefix {
}
const packageJsonImportFilter = createPackageJsonImportFilter(context.sourceFile, context.preferences, context.host);
return info && { ...info, fixes: sortFixes(info.fixes, context.sourceFile, context.program, packageJsonImportFilter) };
return info && { ...info, fixes: sortFixes(info.fixes, context.sourceFile, context.program, packageJsonImportFilter, context.host) };
}
function sortFixes(fixes: readonly ImportFixWithModuleSpecifier[], sourceFile: SourceFile, program: Program, packageJsonImportFilter: PackageJsonImportFilter): readonly ImportFixWithModuleSpecifier[] {
return sort(fixes, (a, b) => compareValues(a.kind, b.kind) || compareModuleSpecifiers(a, b, sourceFile, program, packageJsonImportFilter.allowsImportingSpecifier));
function sortFixes(fixes: readonly ImportFixWithModuleSpecifier[], sourceFile: SourceFile, program: Program, packageJsonImportFilter: PackageJsonImportFilter, host: LanguageServiceHost): readonly ImportFixWithModuleSpecifier[] {
const _toPath = (fileName: string) => toPath(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host));
return sort(fixes, (a, b) => compareValues(a.kind, b.kind) || compareModuleSpecifiers(a, b, sourceFile, program, packageJsonImportFilter.allowsImportingSpecifier, _toPath));
}
function getBestFix<T extends ImportFixWithModuleSpecifier>(fixes: readonly T[], sourceFile: SourceFile, program: Program, packageJsonImportFilter: PackageJsonImportFilter): T | undefined {
function getBestFix(fixes: readonly ImportFixWithModuleSpecifier[], sourceFile: SourceFile, program: Program, packageJsonImportFilter: PackageJsonImportFilter, host: LanguageServiceHost): ImportFixWithModuleSpecifier | undefined {
if (!some(fixes)) return;
// These will always be placed first if available, and are better than other kinds
if (fixes[0].kind === ImportFixKind.UseNamespace || fixes[0].kind === ImportFixKind.AddToExisting) {
return fixes[0];
}
return fixes.reduce((best, fix) =>
// Takes true branch of conditional if `fix` is better than `best`
compareModuleSpecifiers(fix, best, sourceFile, program, packageJsonImportFilter.allowsImportingSpecifier) === Comparison.LessThan ? fix : best
compareModuleSpecifiers(
fix,
best,
sourceFile,
program,
packageJsonImportFilter.allowsImportingSpecifier,
fileName => toPath(fileName, host.getCurrentDirectory(), hostGetCanonicalFileName(host)),
) === Comparison.LessThan ? fix : best
);
}
/** @returns `Comparison.LessThan` if `a` is better than `b`. */
function compareModuleSpecifiers(a: ImportFixWithModuleSpecifier, b: ImportFixWithModuleSpecifier, importingFile: SourceFile, program: Program, allowsImportingSpecifier: (specifier: string) => boolean): Comparison {
function compareModuleSpecifiers(
a: ImportFixWithModuleSpecifier,
b: ImportFixWithModuleSpecifier,
importingFile: SourceFile,
program: Program,
allowsImportingSpecifier: (specifier: string) => boolean,
toPath: (fileName: string) => Path,
): Comparison {
if (a.kind !== ImportFixKind.UseNamespace && b.kind !== ImportFixKind.UseNamespace) {
return compareBooleans(allowsImportingSpecifier(b.moduleSpecifier), allowsImportingSpecifier(a.moduleSpecifier))
|| compareNodeCoreModuleSpecifiers(a.moduleSpecifier, b.moduleSpecifier, importingFile, program)
|| compareBooleans(isOnlyDotsAndSlashes(a.moduleSpecifier), isOnlyDotsAndSlashes(b.moduleSpecifier))
|| compareBooleans(
isFixPossiblyReExportingImportingFile(a, importingFile, program.getCompilerOptions(), toPath),
isFixPossiblyReExportingImportingFile(b, importingFile, program.getCompilerOptions(), toPath))
|| compareNumberOfDirectorySeparators(a.moduleSpecifier, b.moduleSpecifier);
}
return Comparison.EqualTo;
}
const notDotOrSlashPattern = /[^.\/]/;
function isOnlyDotsAndSlashes(path: string) {
return !notDotOrSlashPattern.test(path);
// This is a simple heuristic to try to avoid creating an import cycle with a barrel re-export.
// E.g., do not `import { Foo } from ".."` when you could `import { Foo } from "../Foo"`.
// This can produce false positives or negatives if re-exports cross into sibling directories
// (e.g. `export * from "../whatever"`) or are not named "index" (we don't even try to consider
// this if we're in a resolution mode where you can't drop trailing "/index" from paths).
function isFixPossiblyReExportingImportingFile(fix: ImportFixWithModuleSpecifier, importingFile: SourceFile, compilerOptions: CompilerOptions, toPath: (fileName: string) => Path): boolean {
if (fix.isReExport &&
fix.exportInfo?.moduleFileName &&
getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeJs &&
isIndexFileName(fix.exportInfo.moduleFileName)
) {
const reExportDir = toPath(getDirectoryPath(fix.exportInfo.moduleFileName));
return startsWith((importingFile.path), reExportDir);
}
return false;
}
function isIndexFileName(fileName: string) {
return getBaseFileName(fileName, [".js", ".jsx", ".d.ts", ".ts", ".tsx"], /*ignoreCase*/ true) === "index";
}
function compareNodeCoreModuleSpecifiers(a: string, b: string, importingFile: SourceFile, program: Program): Comparison {
@@ -742,9 +780,9 @@ namespace ts.codefix {
if (!umdSymbol) return undefined;
const symbol = checker.getAliasedSymbol(umdSymbol);
const symbolName = umdSymbol.name;
const exportInfos: readonly SymbolExportInfo[] = [{ symbol: umdSymbol, moduleSymbol: symbol, moduleFileName: undefined, exportKind: ExportKind.UMD, targetFlags: symbol.flags, isFromPackageJson: false }];
const exportInfo: readonly SymbolExportInfo[] = [{ symbol: umdSymbol, moduleSymbol: symbol, moduleFileName: undefined, exportKind: ExportKind.UMD, targetFlags: symbol.flags, isFromPackageJson: false }];
const useRequire = shouldUseRequire(sourceFile, program);
const fixes = getImportFixes(exportInfos, symbolName, isIdentifier(token) ? token.getStart(sourceFile) : undefined, /*isValidTypeOnlyUseSite*/ false, useRequire, program, sourceFile, host, preferences);
const fixes = getImportFixes(exportInfo, symbolName, isIdentifier(token) ? token.getStart(sourceFile) : undefined, /*isValidTypeOnlyUseSite*/ false, useRequire, program, sourceFile, host, preferences);
return { fixes, symbolName, errorIdentifierText: tryCast(token, isIdentifier)?.text };
}
function getUmdSymbol(token: Node, checker: TypeChecker): Symbol | undefined {
@@ -814,8 +852,8 @@ namespace ts.codefix {
const isValidTypeOnlyUseSite = isValidTypeOnlyAliasUseSite(symbolToken);
const useRequire = shouldUseRequire(sourceFile, program);
const exportInfos = getExportInfos(symbolName, isJSXTagName(symbolToken), getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences);
const fixes = arrayFrom(flatMapIterator(exportInfos.entries(), ([_, exportInfos]) =>
const exportInfo = getExportInfos(symbolName, isJSXTagName(symbolToken), getMeaningFromLocation(symbolToken), cancellationToken, sourceFile, program, useAutoImportProvider, host, preferences);
const fixes = arrayFrom(flatMapIterator(exportInfo.entries(), ([_, exportInfos]) =>
getImportFixes(exportInfos, symbolName, symbolToken.getStart(sourceFile), isValidTypeOnlyUseSite, useRequire, program, sourceFile, host, preferences)));
return { fixes, symbolName, errorIdentifierText: symbolToken.text };
}
@@ -831,10 +869,6 @@ namespace ts.codefix {
return { kind: ImportFixKind.PromoteTypeOnly, typeOnlyAliasDeclaration };
}
function jsxModeNeedsExplicitImport(jsx: JsxEmit | undefined) {
return jsx === JsxEmit.React || jsx === JsxEmit.ReactNative;
}
function getSymbolName(sourceFile: SourceFile, checker: TypeChecker, symbolToken: Identifier, compilerOptions: CompilerOptions): string {
const parent = symbolToken.parent;
if ((isJsxOpeningLikeElement(parent) || isJsxClosingElement(parent)) && parent.tagName === symbolToken && jsxModeNeedsExplicitImport(compilerOptions.jsx)) {
+22 -14
View File
@@ -1680,7 +1680,8 @@ namespace ts.Completions {
case SyntaxKind.NewKeyword:
return checker.getContextualType(parent as Expression);
case SyntaxKind.CaseKeyword:
return getSwitchedType(cast(parent, isCaseClause), checker);
const caseClause = tryCast(parent, isCaseClause);
return caseClause ? getSwitchedType(caseClause, checker) : undefined;
case SyntaxKind.OpenBraceToken:
return isJsxExpression(parent) && !isJsxElement(parent.parent) && !isJsxFragment(parent.parent) ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined;
default:
@@ -2495,19 +2496,26 @@ namespace ts.Completions {
preferences,
!!importCompletionNode,
context => {
exportInfo.forEach(sourceFile.path, (info, getSymbolName, isFromAmbientModule, exportMapKey) => {
const symbolName = getSymbolName(/*preferCapitalized*/ isRightOfOpenTag);
if (!isIdentifierText(symbolName, getEmitScriptTarget(host.getCompilationSettings()))) return;
if (!detailsEntryId && isStringANonContextualKeyword(symbolName)) return;
// `targetFlags` should be the same for each `info`
if (!isTypeOnlyLocation && !importCompletionNode && !(info[0].targetFlags & SymbolFlags.Value)) return;
if (isTypeOnlyLocation && !(info[0].targetFlags & (SymbolFlags.Module | SymbolFlags.Type))) return;
// Do not try to auto-import something with a lowercase first letter for a JSX tag
const firstChar = symbolName.charCodeAt(0);
if (isRightOfOpenTag && (firstChar < CharacterCodes.A || firstChar > CharacterCodes.Z)) return;
exportInfo.search(
sourceFile.path,
/*preferCapitalized*/ isRightOfOpenTag,
(symbolName, targetFlags) => {
if (!isIdentifierText(symbolName, getEmitScriptTarget(host.getCompilationSettings()))) return false;
if (!detailsEntryId && isStringANonContextualKeyword(symbolName)) return false;
if (!isTypeOnlyLocation && !importCompletionNode && !(targetFlags & SymbolFlags.Value)) return false;
if (isTypeOnlyLocation && !(targetFlags & (SymbolFlags.Module | SymbolFlags.Type))) return false;
// Do not try to auto-import something with a lowercase first letter for a JSX tag
const firstChar = symbolName.charCodeAt(0);
if (isRightOfOpenTag && (firstChar < CharacterCodes.A || firstChar > CharacterCodes.Z)) return false;
if (detailsEntryId) return true;
return charactersFuzzyMatchInString(symbolName, lowerCaseTokenText);
},
(info, symbolName, isFromAmbientModule, exportMapKey) => {
if (detailsEntryId && !some(info, i => detailsEntryId.source === stripQuotes(i.moduleSymbol.name))) {
return;
}
const isCompletionDetailsMatch = detailsEntryId && some(info, i => detailsEntryId.source === stripQuotes(i.moduleSymbol.name));
if (isCompletionDetailsMatch || !detailsEntryId && charactersFuzzyMatchInString(symbolName, lowerCaseTokenText)) {
const defaultExportInfo = find(info, isImportableExportInfo);
if (!defaultExportInfo) {
return;
@@ -2531,7 +2539,7 @@ namespace ts.Completions {
isFromPackageJson: exportInfo.isFromPackageJson,
});
}
});
);
hasUnresolvedAutoImports = context.resolutionLimitExceeded();
}
+20
View File
@@ -202,7 +202,27 @@ namespace ts {
scriptKind?: ScriptKind): SourceFile {
scriptKind = ensureScriptKind(fileName, scriptKind);
const scriptTarget = scriptKind === ScriptKind.JSON ? ScriptTarget.JSON : getEmitScriptTarget(compilationSettings);
const oldBucketCount = buckets.size;
const bucket = getOrUpdate(buckets, key, () => new Map());
if (tracing) {
if (buckets.size > oldBucketCount) {
// It is interesting, but not definitively problematic if a build requires multiple document registry buckets -
// perhaps they are for two projects that don't have any overlap.
// Bonus: these events can help us interpret the more interesting event below.
tracing.instant(tracing.Phase.Session, "createdDocumentRegistryBucket", { configFilePath: compilationSettings.configFilePath, key });
}
// It is fairly suspicious to have one path in two buckets - you'd expect dependencies to have similar configurations.
// If this occurs unexpectedly, the fix is likely to synchronize the project settings.
// Skip .d.ts files to reduce noise (should also cover most of node_modules).
const otherBucketKey = !fileExtensionIs(path, Extension.Dts) &&
forEachEntry(buckets, (bucket, bucketKey) => bucketKey !== key && bucket.has(path) && bucketKey);
if (otherBucketKey) {
tracing.instant(tracing.Phase.Session, "documentRegistryBucketOverlap", { path, key1: otherBucketKey, key2: key });
}
}
const bucketEntry = bucket.get(path);
let entry = bucketEntry && getDocumentRegistryEntry(bucketEntry, scriptKind);
if (!entry && externalCache) {
+18 -20
View File
@@ -29,6 +29,7 @@ namespace ts {
// Used to rehydrate `symbol` and `moduleSymbol` when transient
id: number;
symbolName: string;
capitalizedSymbolName: string | undefined;
symbolTableKey: __String;
moduleName: string;
moduleFile: SourceFile | undefined;
@@ -48,7 +49,7 @@ namespace ts {
clear(): void;
add(importingFile: Path, symbol: Symbol, key: __String, moduleSymbol: Symbol, moduleFile: SourceFile | undefined, exportKind: ExportKind, isFromPackageJson: boolean, checker: TypeChecker): void;
get(importingFile: Path, key: string): readonly SymbolExportInfo[] | undefined;
forEach(importingFile: Path, action: (info: readonly SymbolExportInfo[], getSymbolName: (preferCapitalized?: boolean) => string, isFromAmbientModule: boolean, key: string) => void): void;
search(importingFile: Path, preferCapitalized: boolean, matches: (name: string, targetFlags: SymbolFlags) => boolean, action: (info: readonly SymbolExportInfo[], symbolName: string, isFromAmbientModule: boolean, key: string) => void): void;
releaseSymbols(): void;
isEmpty(): boolean;
/** @returns Whether the change resulted in the cache being cleared */
@@ -121,9 +122,12 @@ namespace ts {
// 3. Otherwise, we have a default/namespace import that can be imported by any name, and
// `symbolTableKey` will be something undesirable like `export=` or `default`, so we try to
// get a better name.
const importedName = exportKind === ExportKind.Named || isExternalModuleSymbol(namedSymbol)
const names = exportKind === ExportKind.Named || isExternalModuleSymbol(namedSymbol)
? unescapeLeadingUnderscores(symbolTableKey)
: getNameForExportedSymbol(namedSymbol, /*scriptTarget*/ undefined);
: getNamesForExportedSymbol(namedSymbol, /*scriptTarget*/ undefined);
const symbolName = typeof names === "string" ? names : names[0];
const capitalizedSymbolName = typeof names === "string" ? undefined : names[1];
const moduleName = stripQuotes(moduleSymbol.name);
const id = exportInfoId++;
@@ -132,10 +136,11 @@ namespace ts {
const storedModuleSymbol = moduleSymbol.flags & SymbolFlags.Transient ? undefined : moduleSymbol;
if (!storedSymbol || !storedModuleSymbol) symbols.set(id, [symbol, moduleSymbol]);
exportInfo.add(key(importedName, symbol, isExternalModuleNameRelative(moduleName) ? undefined : moduleName, checker), {
exportInfo.add(key(symbolName, symbol, isExternalModuleNameRelative(moduleName) ? undefined : moduleName, checker), {
id,
symbolTableKey,
symbolName: importedName,
symbolName,
capitalizedSymbolName,
moduleName,
moduleFile,
moduleFileName: moduleFile?.fileName,
@@ -152,24 +157,17 @@ namespace ts {
const result = exportInfo.get(key);
return result?.map(rehydrateCachedInfo);
},
forEach: (importingFile, action) => {
search: (importingFile, preferCapitalized, matches, action) => {
if (importingFile !== usableByFileName) return;
exportInfo.forEach((info, key) => {
const { symbolName, ambientModuleName } = parseKey(key);
const rehydrated = info.map(rehydrateCachedInfo);
const filtered = rehydrated.filter((r, i) => isNotShadowedByDeeperNodeModulesPackage(r, info[i].packageName));
if (filtered.length) {
action(
filtered,
preferCapitalized => {
const { symbol, exportKind } = rehydrated[0];
const namedSymbol = exportKind === ExportKind.Default && getLocalSymbolForExportDefault(symbol) || symbol;
return preferCapitalized
? getNameForExportedSymbol(namedSymbol, /*scriptTarget*/ undefined, /*preferCapitalized*/ true)
: symbolName;
},
!!ambientModuleName,
key);
const name = preferCapitalized && info[0].capitalizedSymbolName || symbolName;
if (matches(name, info[0].targetFlags)) {
const rehydrated = info.map(rehydrateCachedInfo);
const filtered = rehydrated.filter((r, i) => isNotShadowedByDeeperNodeModulesPackage(r, info[i].packageName));
if (filtered.length) {
action(filtered, name, !!ambientModuleName, key);
}
}
});
},
+2
View File
@@ -432,6 +432,8 @@ namespace ts.formatting {
case SyntaxKind.ConstructorType:
case SyntaxKind.ConstructSignature:
return getList((node as SignatureDeclaration).typeParameters) || getList((node as SignatureDeclaration).parameters);
case SyntaxKind.GetAccessor:
return getList((node as GetAccessorDeclaration).parameters);
case SyntaxKind.ClassDeclaration:
case SyntaxKind.ClassExpression:
case SyntaxKind.InterfaceDeclaration:
+21 -1
View File
@@ -169,7 +169,27 @@ namespace ts.JsDoc {
case SyntaxKind.JSDocAugmentsTag:
return withNode((tag as JSDocAugmentsTag).class);
case SyntaxKind.JSDocTemplateTag:
return addComment((tag as JSDocTemplateTag).typeParameters.map(tp => tp.getText()).join(", "));
const templateTag = tag as JSDocTemplateTag;
const displayParts: SymbolDisplayPart[] = [];
if (templateTag.constraint) {
displayParts.push(textPart(templateTag.constraint.getText()));
}
if (length(templateTag.typeParameters)) {
if (length(displayParts)) {
displayParts.push(spacePart());
}
const lastTypeParameter = templateTag.typeParameters[templateTag.typeParameters.length - 1];
forEach(templateTag.typeParameters, tp => {
displayParts.push(namePart(tp.getText()));
if (lastTypeParameter !== tp) {
displayParts.push(...[punctuationPart(SyntaxKind.CommaToken), spacePart()]);
}
});
}
if (comment) {
displayParts.push(...[spacePart(), ...getDisplayPartsFromComment(comment, checker)]);
}
return displayParts;
case SyntaxKind.JSDocTypeTag:
return withNode((tag as JSDocTypeTag).typeExpression);
case SyntaxKind.JSDocTypedefTag:
+19 -3
View File
@@ -95,6 +95,7 @@ namespace ts.OrganizeImports {
}
const typeChecker = program.getTypeChecker();
const compilerOptions = program.getCompilerOptions();
const jsxNamespace = typeChecker.getJsxNamespace(sourceFile);
const jsxFragmentFactory = typeChecker.getJsxFragmentFactory(sourceFile);
const jsxElementsPresent = !!(sourceFile.transformFlags & TransformFlags.ContainsJsx);
@@ -162,7 +163,7 @@ namespace ts.OrganizeImports {
function isDeclarationUsed(identifier: Identifier) {
// The JSX factory symbol is always used if JSX elements are present - even if they are not allowed.
return jsxElementsPresent && (identifier.text === jsxNamespace || jsxFragmentFactory && identifier.text === jsxFragmentFactory) ||
return jsxElementsPresent && (identifier.text === jsxNamespace || jsxFragmentFactory && identifier.text === jsxFragmentFactory) && jsxModeNeedsExplicitImport(compilerOptions.jsx) ||
FindAllReferences.Core.isSymbolReferencedInFile(identifier, typeChecker, sourceFile);
}
}
@@ -236,10 +237,9 @@ namespace ts.OrganizeImports {
}
}
newImportSpecifiers.push(...flatMap(namedImports, i => (i.importClause!.namedBindings as NamedImports).elements)); // TODO: GH#18217
newImportSpecifiers.push(...getNewImportSpecifiers(namedImports));
const sortedImportSpecifiers = sortSpecifiers(newImportSpecifiers);
const importDecl = defaultImports.length > 0
? defaultImports[0]
: namedImports[0];
@@ -492,4 +492,20 @@ namespace ts.OrganizeImports {
return 6;
}
}
function getNewImportSpecifiers(namedImports: ImportDeclaration[]) {
return flatMap(namedImports, namedImport =>
map(tryGetNamedBindingElements(namedImport), importSpecifier =>
importSpecifier.name && importSpecifier.propertyName && importSpecifier.name.escapedText === importSpecifier.propertyName.escapedText
? factory.updateImportSpecifier(importSpecifier, importSpecifier.isTypeOnly, /*propertyName*/ undefined, importSpecifier.name)
: importSpecifier
)
);
}
function tryGetNamedBindingElements(namedImport: ImportDeclaration) {
return namedImport.importClause?.namedBindings && isNamedImports(namedImport.importClause.namedBindings)
? namedImport.importClause.namedBindings.elements
: undefined;
}
}
+57 -32
View File
@@ -2,46 +2,48 @@
namespace ts.refactor {
const refactorName = "Convert import";
const namespaceToNamedAction = {
name: "Convert namespace import to named imports",
description: Diagnostics.Convert_namespace_import_to_named_imports.message,
kind: "refactor.rewrite.import.named",
};
const namedToNamespaceAction = {
name: "Convert named imports to namespace import",
description: Diagnostics.Convert_named_imports_to_namespace_import.message,
kind: "refactor.rewrite.import.namespace",
const actions = {
[ImportKind.Named]: {
name: "Convert namespace import to named imports",
description: Diagnostics.Convert_namespace_import_to_named_imports.message,
kind: "refactor.rewrite.import.named",
},
[ImportKind.Namespace]: {
name: "Convert named imports to namespace import",
description: Diagnostics.Convert_named_imports_to_namespace_import.message,
kind: "refactor.rewrite.import.namespace",
},
[ImportKind.Default]: {
name: "Convert named imports to default import",
description: Diagnostics.Convert_named_imports_to_default_import.message,
kind: "refactor.rewrite.import.default",
},
};
registerRefactor(refactorName, {
kinds: [
namespaceToNamedAction.kind,
namedToNamespaceAction.kind
],
kinds: getOwnValues(actions).map(a => a.kind),
getAvailableActions: function getRefactorActionsToConvertBetweenNamedAndNamespacedImports(context): readonly ApplicableRefactorInfo[] {
const info = getImportToConvert(context, context.triggerReason === "invoked");
const info = getImportConversionInfo(context, context.triggerReason === "invoked");
if (!info) return emptyArray;
if (!isRefactorErrorInfo(info)) {
const namespaceImport = info.kind === SyntaxKind.NamespaceImport;
const action = namespaceImport ? namespaceToNamedAction : namedToNamespaceAction;
const action = actions[info.convertTo];
return [{ name: refactorName, description: action.description, actions: [action] }];
}
if (context.preferences.provideRefactorNotApplicableReason) {
return [
{ name: refactorName, description: namespaceToNamedAction.description,
actions: [{ ...namespaceToNamedAction, notApplicableReason: info.error }] },
{ name: refactorName, description: namedToNamespaceAction.description,
actions: [{ ...namedToNamespaceAction, notApplicableReason: info.error }] }
];
return getOwnValues(actions).map(action => ({
name: refactorName,
description: action.description,
actions: [{ ...action, notApplicableReason: info.error }]
}));
}
return emptyArray;
},
getEditsForAction: function getRefactorEditsToConvertBetweenNamedAndNamespacedImports(context, actionName): RefactorEditInfo {
Debug.assert(actionName === namespaceToNamedAction.name || actionName === namedToNamespaceAction.name, "Unexpected action name");
const info = getImportToConvert(context);
Debug.assert(some(getOwnValues(actions), action => action.name === actionName), "Unexpected action name");
const info = getImportConversionInfo(context);
Debug.assert(info && !isRefactorErrorInfo(info), "Expected applicable refactor info");
const edits = textChanges.ChangeTracker.with(context, t => doChange(context.file, context.program, t, info));
return { edits, renameFilename: undefined, renameLocation: undefined };
@@ -49,7 +51,12 @@ namespace ts.refactor {
});
// Can convert imports of the form `import * as m from "m";` or `import d, { x, y } from "m";`.
function getImportToConvert(context: RefactorContext, considerPartialSpans = true): NamedImportBindings | RefactorErrorInfo | undefined {
type ImportConversionInfo =
| { convertTo: ImportKind.Default, import: NamedImports }
| { convertTo: ImportKind.Namespace, import: NamedImports }
| { convertTo: ImportKind.Named, import: NamespaceImport };
function getImportConversionInfo(context: RefactorContext, considerPartialSpans = true): ImportConversionInfo | RefactorErrorInfo | undefined {
const { file } = context;
const span = getRefactorContextSpan(context);
const token = getTokenAtPosition(file, span.start);
@@ -69,16 +76,25 @@ namespace ts.refactor {
return { error: getLocaleSpecificMessage(Diagnostics.Could_not_find_namespace_import_or_named_imports) };
}
return importClause.namedBindings;
if (importClause.namedBindings.kind === SyntaxKind.NamespaceImport) {
return { convertTo: ImportKind.Named, import: importClause.namedBindings };
}
const compilerOptions = context.program.getCompilerOptions();
const shouldUseDefault = getAllowSyntheticDefaultImports(compilerOptions)
&& isExportEqualsModule(importClause.parent.moduleSpecifier, context.program.getTypeChecker());
return shouldUseDefault
? { convertTo: ImportKind.Default, import: importClause.namedBindings }
: { convertTo: ImportKind.Namespace, import: importClause.namedBindings };
}
function doChange(sourceFile: SourceFile, program: Program, changes: textChanges.ChangeTracker, toConvert: NamedImportBindings): void {
function doChange(sourceFile: SourceFile, program: Program, changes: textChanges.ChangeTracker, info: ImportConversionInfo): void {
const checker = program.getTypeChecker();
if (toConvert.kind === SyntaxKind.NamespaceImport) {
doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, getAllowSyntheticDefaultImports(program.getCompilerOptions()));
if (info.convertTo === ImportKind.Named) {
doChangeNamespaceToNamed(sourceFile, checker, changes, info.import, getAllowSyntheticDefaultImports(program.getCompilerOptions()));
}
else {
doChangeNamedToNamespace(sourceFile, checker, changes, toConvert);
doChangeNamedToNamespaceOrDefault(sourceFile, checker, changes, info.import, info.convertTo === ImportKind.Default);
}
}
@@ -137,7 +153,7 @@ namespace ts.refactor {
return isPropertyAccessExpression(propertyAccessOrQualifiedName) ? propertyAccessOrQualifiedName.expression : propertyAccessOrQualifiedName.left;
}
function doChangeNamedToNamespace(sourceFile: SourceFile, checker: TypeChecker, changes: textChanges.ChangeTracker, toConvert: NamedImports): void {
function doChangeNamedToNamespaceOrDefault(sourceFile: SourceFile, checker: TypeChecker, changes: textChanges.ChangeTracker, toConvert: NamedImports, shouldUseDefault: boolean) {
const importDecl = toConvert.parent.parent;
const { moduleSpecifier } = importDecl;
@@ -188,7 +204,9 @@ namespace ts.refactor {
});
}
changes.replaceNode(sourceFile, toConvert, factory.createNamespaceImport(factory.createIdentifier(namespaceImportName)));
changes.replaceNode(sourceFile, toConvert, shouldUseDefault
? factory.createIdentifier(namespaceImportName)
: factory.createNamespaceImport(factory.createIdentifier(namespaceImportName)));
if (neededNamedImports.size) {
const newNamedImports: ImportSpecifier[] = arrayFrom(neededNamedImports.values()).map(element =>
factory.createImportSpecifier(element.isTypeOnly, element.propertyName && factory.createIdentifier(element.propertyName.text), factory.createIdentifier(element.name.text)));
@@ -196,6 +214,13 @@ namespace ts.refactor {
}
}
function isExportEqualsModule(moduleSpecifier: Expression, checker: TypeChecker) {
const externalModule = checker.resolveExternalModuleName(moduleSpecifier);
if (!externalModule) return false;
const exportEquals = checker.resolveExternalModuleSymbol(externalModule);
return externalModule !== exportEquals;
}
function updateImport(old: ImportDeclaration, defaultImportName: Identifier | undefined, elements: readonly ImportSpecifier[] | undefined): ImportDeclaration {
return factory.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined,
factory.createImportClause(/*isTypeOnly*/ false, defaultImportName, elements && elements.length ? factory.createNamedImports(elements) : undefined), old.moduleSpecifier, /*assertClause*/ undefined);
@@ -1,7 +1,7 @@
/* @internal */
namespace ts.refactor.convertParamsToDestructuredObject {
const refactorName = "Convert parameters to destructured object";
const minimumParameterLength = 2;
const minimumParameterLength = 1;
const refactorDescription = getLocaleSpecificMessage(Diagnostics.Convert_parameters_to_destructured_object);
const toDestructuredAction = {
+2 -2
View File
@@ -486,8 +486,8 @@ namespace ts.refactor.extractSymbol {
// but a super *method call* simply implies a 'this' reference
if (node.parent.kind === SyntaxKind.CallExpression) {
// Super constructor call
const containingClass = getContainingClass(node)!; // TODO:GH#18217
if (containingClass.pos < span.start || containingClass.end >= (span.start + span.length)) {
const containingClass = getContainingClass(node);
if (containingClass === undefined || containingClass.pos < span.start || containingClass.end >= (span.start + span.length)) {
(errors ||= []).push(createDiagnosticForNode(node, Messages.cannotExtractSuper));
return true;
}
+9 -10
View File
@@ -169,12 +169,12 @@ namespace ts.SignatureHelp {
: { invocation: info.invocation.node, argumentCount: info.argumentCount, argumentIndex: info.argumentIndex };
}
function getArgumentOrParameterListInfo(node: Node, sourceFile: SourceFile): { readonly list: Node, readonly argumentIndex: number, readonly argumentCount: number, readonly argumentsSpan: TextSpan } | undefined {
function getArgumentOrParameterListInfo(node: Node, position: number, sourceFile: SourceFile): { readonly list: Node, readonly argumentIndex: number, readonly argumentCount: number, readonly argumentsSpan: TextSpan } | undefined {
const info = getArgumentOrParameterListAndIndex(node, sourceFile);
if (!info) return undefined;
const { list, argumentIndex } = info;
const argumentCount = getArgumentCount(list);
const argumentCount = getArgumentCount(list, /*ignoreTrailingComma*/ isInString(sourceFile, position, node));
if (argumentIndex !== 0) {
Debug.assertLessThan(argumentIndex, argumentCount);
}
@@ -222,7 +222,7 @@ namespace ts.SignatureHelp {
// Case 3:
// foo<T#, U#>(a#, #b#) -> The token is buried inside a list, and should give signature help
// Find out if 'node' is an argument, a type argument, or neither
const info = getArgumentOrParameterListInfo(node, sourceFile);
const info = getArgumentOrParameterListInfo(node, position, sourceFile);
if (!info) return undefined;
const { list, argumentIndex, argumentCount, argumentsSpan } = info;
const isTypeParameterList = !!parent.typeArguments && parent.typeArguments.pos === list.pos;
@@ -299,8 +299,8 @@ namespace ts.SignatureHelp {
return isBinaryExpression(b.left) ? countBinaryExpressionParameters(b.left) + 1 : 2;
}
function tryGetParameterInfo(startingToken: Node, _position: number, sourceFile: SourceFile, checker: TypeChecker): ArgumentListInfo | undefined {
const info = getContextualSignatureLocationInfo(startingToken, sourceFile, checker);
function tryGetParameterInfo(startingToken: Node, position: number, sourceFile: SourceFile, checker: TypeChecker): ArgumentListInfo | undefined {
const info = getContextualSignatureLocationInfo(startingToken, sourceFile, position, checker);
if (!info) return undefined;
const { contextualType, argumentIndex, argumentCount, argumentsSpan } = info;
@@ -315,7 +315,7 @@ namespace ts.SignatureHelp {
}
interface ContextualSignatureLocationInfo { readonly contextualType: Type; readonly argumentIndex: number; readonly argumentCount: number; readonly argumentsSpan: TextSpan; }
function getContextualSignatureLocationInfo(startingToken: Node, sourceFile: SourceFile, checker: TypeChecker): ContextualSignatureLocationInfo | undefined {
function getContextualSignatureLocationInfo(startingToken: Node, sourceFile: SourceFile, position: number, checker: TypeChecker): ContextualSignatureLocationInfo | undefined {
if (startingToken.kind !== SyntaxKind.OpenParenToken && startingToken.kind !== SyntaxKind.CommaToken) return undefined;
const { parent } = startingToken;
switch (parent.kind) {
@@ -323,7 +323,7 @@ namespace ts.SignatureHelp {
case SyntaxKind.MethodDeclaration:
case SyntaxKind.FunctionExpression:
case SyntaxKind.ArrowFunction:
const info = getArgumentOrParameterListInfo(startingToken, sourceFile);
const info = getArgumentOrParameterListInfo(startingToken, position, sourceFile);
if (!info) return undefined;
const { argumentIndex, argumentCount, argumentsSpan } = info;
const contextualType = isMethodDeclaration(parent) ? checker.getContextualTypeForObjectLiteralElement(parent) : checker.getContextualType(parent as ParenthesizedExpression | FunctionExpression | ArrowFunction);
@@ -372,7 +372,7 @@ namespace ts.SignatureHelp {
return argumentIndex;
}
function getArgumentCount(argumentsList: Node) {
function getArgumentCount(argumentsList: Node, ignoreTrailingComma: boolean) {
// The argument count for a list is normally the number of non-comma children it has.
// For example, if you have "Foo(a,b)" then there will be three children of the arg
// list 'a' '<comma>' 'b'. So, in this case the arg count will be 2. However, there
@@ -387,10 +387,9 @@ namespace ts.SignatureHelp {
const listChildren = argumentsList.getChildren();
let argumentCount = countWhere(listChildren, arg => arg.kind !== SyntaxKind.CommaToken);
if (listChildren.length > 0 && last(listChildren).kind === SyntaxKind.CommaToken) {
if (!ignoreTrailingComma && listChildren.length > 0 && last(listChildren).kind === SyntaxKind.CommaToken) {
argumentCount++;
}
return argumentCount;
}
+68 -4
View File
@@ -368,9 +368,20 @@ namespace ts.Completions.StringCompletions {
}
}
function isEmitResolutionKindUsingNodeModules(compilerOptions: CompilerOptions): boolean {
return getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeJs ||
getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node12 ||
getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext;
}
function isEmitModuleResolutionRespectingExportMaps(compilerOptions: CompilerOptions) {
return getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.Node12 ||
getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeNext;
}
function getSupportedExtensionsForModuleResolution(compilerOptions: CompilerOptions): readonly Extension[][] {
const extensions = getSupportedExtensions(compilerOptions);
return getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeJs ?
return isEmitResolutionKindUsingNodeModules(compilerOptions) ?
getSupportedExtensionsWithJsonIfResolveJsonModule(compilerOptions, extensions) :
extensions;
}
@@ -549,7 +560,7 @@ namespace ts.Completions.StringCompletions {
getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, fragmentDirectory, extensionOptions, result);
if (getEmitModuleResolutionKind(compilerOptions) === ModuleResolutionKind.NodeJs) {
if (isEmitResolutionKindUsingNodeModules(compilerOptions)) {
// If looking for a global package name, don't just include everything in `node_modules` because that includes dependencies' own dependencies.
// (But do if we didn't find anything, e.g. 'package.json' missing.)
let foundGlobal = false;
@@ -562,12 +573,65 @@ namespace ts.Completions.StringCompletions {
}
}
if (!foundGlobal) {
forEachAncestorDirectory(scriptPath, ancestor => {
let ancestorLookup: (directory: string) => void | undefined = ancestor => {
const nodeModules = combinePaths(ancestor, "node_modules");
if (tryDirectoryExists(host, nodeModules)) {
getCompletionEntriesForDirectoryFragment(fragment, nodeModules, extensionOptions, host, /*exclude*/ undefined, result);
}
});
};
if (fragmentDirectory && isEmitModuleResolutionRespectingExportMaps(compilerOptions)) {
const nodeModulesDirectoryLookup = ancestorLookup;
ancestorLookup = ancestor => {
const components = getPathComponents(fragment);
components.shift(); // shift off empty root
let packagePath = components.shift();
if (!packagePath) {
return nodeModulesDirectoryLookup(ancestor);
}
if (startsWith(packagePath, "@")) {
const subName = components.shift();
if (!subName) {
return nodeModulesDirectoryLookup(ancestor);
}
packagePath = combinePaths(packagePath, subName);
}
const packageFile = combinePaths(ancestor, "node_modules", packagePath, "package.json");
if (tryFileExists(host, packageFile)) {
const packageJson = readJson(packageFile, host as { readFile: (filename: string) => string | undefined });
const exports = (packageJson as any).exports;
if (exports) {
if (typeof exports !== "object" || exports === null) { // eslint-disable-line no-null/no-null
return; // null exports or entrypoint only, no sub-modules available
}
const keys = getOwnKeys(exports);
const fragmentSubpath = components.join("/");
const processedKeys = mapDefined(keys, k => {
if (k === ".") return undefined;
if (!startsWith(k, "./")) return undefined;
const subpath = k.substring(2);
if (!startsWith(subpath, fragmentSubpath)) return undefined;
// subpath is a valid export (barring conditions, which we don't currently check here)
if (!stringContains(subpath, "*")) {
return subpath;
}
// pattern export - only return everything up to the `*`, so the user can autocomplete, then
// keep filling in the pattern (we could speculatively return a list of options by hitting disk,
// but conditions will make that somewhat awkward, as each condition may have a different set of possible
// options for the `*`.
return subpath.slice(0, subpath.indexOf("*"));
});
forEach(processedKeys, k => {
if (k) {
result.push(nameAndKind(k, ScriptElementKind.externalModuleName, /*extension*/ undefined));
}
});
return;
}
}
return nodeModulesDirectoryLookup(ancestor);
};
}
forEachAncestorDirectory(scriptPath, ancestorLookup);
}
}
+13
View File
@@ -584,6 +584,19 @@ namespace ts.SymbolDisplay {
}
}
if (documentation.length === 0 && isIdentifier(location) && symbol.valueDeclaration && isBindingElement(symbol.valueDeclaration)) {
const declaration = symbol.valueDeclaration;
const parent = declaration.parent;
if (isIdentifier(declaration.name) && isObjectBindingPattern(parent)) {
const name = getTextOfIdentifierOrLiteral(declaration.name);
const objectType = typeChecker.getTypeAtLocation(parent);
documentation = firstDefined(objectType.isUnion() ? objectType.types : [objectType], t => {
const prop = t.getProperty(name);
return prop ? prop.getDocumentationComment(typeChecker) : undefined;
}) || emptyArray;
}
}
if (tags.length === 0 && !hasMultipleSignatures) {
tags = symbol.getContextualJsDocTags(enclosingDeclaration, typeChecker);
}
+15 -14
View File
@@ -303,7 +303,7 @@ namespace ts.textChanges {
export class ChangeTracker {
private readonly changes: Change[] = [];
private readonly newFiles: { readonly oldFile: SourceFile | undefined, readonly fileName: string, readonly statements: readonly (Statement | SyntaxKind.NewLineTrivia)[] }[] = [];
private readonly classesWithNodesInsertedAtStart = new Map<number, { readonly node: ClassDeclaration | InterfaceDeclaration | ObjectLiteralExpression, readonly sourceFile: SourceFile }>(); // Set<ClassDeclaration> implemented as Map<node id, ClassDeclaration>
private readonly classesWithNodesInsertedAtStart = new Map<number, { readonly node: ClassLikeDeclaration | InterfaceDeclaration | ObjectLiteralExpression, readonly sourceFile: SourceFile }>(); // Set<ClassDeclaration> implemented as Map<node id, ClassDeclaration>
private readonly deletedNodes: { readonly sourceFile: SourceFile, readonly node: Node | NodeArray<TypeParameterDeclaration> }[] = [];
public static fromContext(context: TextChangesContext): ChangeTracker {
@@ -495,29 +495,30 @@ namespace ts.textChanges {
this.insertNodeAt(sourceFile, fnStart, tag, { preserveLeadingWhitespace: false, suffix: this.newLineCharacter + indent });
}
private createJSDocText(sourceFile: SourceFile, node: HasJSDoc) {
const comments = flatMap(node.jsDoc, jsDoc =>
isString(jsDoc.comment) ? factory.createJSDocText(jsDoc.comment) : jsDoc.comment) as JSDocComment[];
const jsDoc = singleOrUndefined(node.jsDoc);
return jsDoc && positionsAreOnSameLine(jsDoc.pos, jsDoc.end, sourceFile) && length(comments) === 0 ? undefined :
factory.createNodeArray(intersperse(comments, factory.createJSDocText("\n")));
}
public replaceJSDocComment(sourceFile: SourceFile, node: HasJSDoc, tags: readonly JSDocTag[]) {
this.insertJsdocCommentBefore(sourceFile, updateJSDocHost(node), factory.createJSDocComment(this.createJSDocText(sourceFile, node), factory.createNodeArray(tags)));
}
public addJSDocTags(sourceFile: SourceFile, parent: HasJSDoc, newTags: readonly JSDocTag[]): void {
const comments = flatMap(parent.jsDoc, j => typeof j.comment === "string" ? factory.createJSDocText(j.comment) : j.comment) as JSDocComment[];
const oldTags = flatMapToMutable(parent.jsDoc, j => j.tags);
const unmergedNewTags = newTags.filter(newTag => !oldTags.some((tag, i) => {
const merged = tryMergeJsdocTags(tag, newTag);
if (merged) oldTags[i] = merged;
return !!merged;
}));
const tags = [...oldTags, ...unmergedNewTags];
const jsDoc = singleOrUndefined(parent.jsDoc);
const comment = jsDoc && positionsAreOnSameLine(jsDoc.pos, jsDoc.end, sourceFile) && !length(comments) ? undefined :
factory.createNodeArray(intersperse(comments, factory.createJSDocText("\n")));
const tag = factory.createJSDocComment(comment, factory.createNodeArray(tags));
const host = updateJSDocHost(parent);
this.insertJsdocCommentBefore(sourceFile, host, tag);
this.replaceJSDocComment(sourceFile, parent, [...oldTags, ...unmergedNewTags]);
}
public filterJSDocTags(sourceFile: SourceFile, parent: HasJSDoc, predicate: (tag: JSDocTag) => boolean): void {
const comments = flatMap(parent.jsDoc, j => typeof j.comment === "string" ? factory.createJSDocText(j.comment) : j.comment) as JSDocComment[];
const oldTags = flatMapToMutable(parent.jsDoc, j => j.tags);
const tag = factory.createJSDocComment(factory.createNodeArray(intersperse(comments, factory.createJSDocText("\n"))), factory.createNodeArray([...(filter(oldTags, predicate) || emptyArray)]));
const host = updateJSDocHost(parent);
this.insertJsdocCommentBefore(sourceFile, host, tag);
this.replaceJSDocComment(sourceFile, parent, filter(flatMapToMutable(parent.jsDoc, j => j.tags), predicate));
}
public replaceRangeWithText(sourceFile: SourceFile, range: TextRange, text: string): void {
+1
View File
@@ -87,6 +87,7 @@
"codefixes/fixExtendsInterfaceBecomesImplements.ts",
"codefixes/fixForgottenThisPropertyAccess.ts",
"codefixes/fixInvalidJsxCharacters.ts",
"codefixes/fixUnmatchedParameter.ts",
"codefixes/fixUnusedIdentifier.ts",
"codefixes/fixUnreachableCode.ts",
"codefixes/fixUnusedLabel.ts",
+28 -3
View File
@@ -2320,7 +2320,7 @@ namespace ts {
if (text) parts.push(linkTextPart(text));
}
else {
parts.push(linkTextPart(name + (suffix ? "" : " ") + text));
parts.push(linkTextPart(name + (suffix || text.indexOf("://") === 0 ? "" : " ") + text));
}
}
parts.push(linkPart("}"));
@@ -3210,13 +3210,34 @@ namespace ts {
return isArray(valueOrArray) ? first(valueOrArray) : valueOrArray;
}
export function getNamesForExportedSymbol(symbol: Symbol, scriptTarget: ScriptTarget | undefined): string | [lowercase: string, capitalized: string] {
if (needsNameFromDeclaration(symbol)) {
const fromDeclaration = getDefaultLikeExportNameFromDeclaration(symbol);
if (fromDeclaration) return fromDeclaration;
const fileNameCase = codefix.moduleSymbolToValidIdentifier(getSymbolParentOrFail(symbol), scriptTarget, /*preferCapitalized*/ false);
const capitalized = codefix.moduleSymbolToValidIdentifier(getSymbolParentOrFail(symbol), scriptTarget, /*preferCapitalized*/ true);
if (fileNameCase === capitalized) return fileNameCase;
return [fileNameCase, capitalized];
}
return symbol.name;
}
export function getNameForExportedSymbol(symbol: Symbol, scriptTarget: ScriptTarget | undefined, preferCapitalized?: boolean) {
if (!(symbol.flags & SymbolFlags.Transient) && (symbol.escapedName === InternalSymbolName.ExportEquals || symbol.escapedName === InternalSymbolName.Default)) {
if (needsNameFromDeclaration(symbol)) {
// Name of "export default foo;" is "foo". Name of "export default 0" is the filename converted to camelCase.
return firstDefined(symbol.declarations, d => isExportAssignment(d) ? tryCast(skipOuterExpressions(d.expression), isIdentifier)?.text : undefined)
return getDefaultLikeExportNameFromDeclaration(symbol)
|| codefix.moduleSymbolToValidIdentifier(getSymbolParentOrFail(symbol), scriptTarget, !!preferCapitalized);
}
return symbol.name;
}
function needsNameFromDeclaration(symbol: Symbol) {
return !(symbol.flags & SymbolFlags.Transient) && (symbol.escapedName === InternalSymbolName.ExportEquals || symbol.escapedName === InternalSymbolName.Default);
}
function getDefaultLikeExportNameFromDeclaration(symbol: Symbol) {
return firstDefined(symbol.declarations, d => isExportAssignment(d) ? tryCast(skipOuterExpressions(d.expression), isIdentifier)?.text : undefined);
}
function getSymbolParentOrFail(symbol: Symbol) {
@@ -3314,5 +3335,9 @@ namespace ts {
};
}
export function jsxModeNeedsExplicitImport(jsx: JsxEmit | undefined) {
return jsx === JsxEmit.React || jsx === JsxEmit.ReactNative;
}
// #endregion
}
@@ -87,8 +87,8 @@ namespace ts.projectSystem {
// transient symbols are recreated with every new checker.
const programBefore = project.getCurrentProgram()!;
let sigintPropBefore: readonly SymbolExportInfo[] | undefined;
exportMapCache.forEach(bTs.path as Path, (info, getSymbolName) => {
if (getSymbolName() === "SIGINT") sigintPropBefore = info;
exportMapCache.search(bTs.path as Path, /*preferCapitalized*/ false, returnTrue, (info, symbolName) => {
if (symbolName === "SIGINT") sigintPropBefore = info;
});
assert.ok(sigintPropBefore);
assert.ok(sigintPropBefore![0].symbol.flags & SymbolFlags.Transient);
@@ -113,8 +113,8 @@ namespace ts.projectSystem {
// Get same info from cache again
let sigintPropAfter: readonly SymbolExportInfo[] | undefined;
exportMapCache.forEach(bTs.path as Path, (info, getSymbolName) => {
if (getSymbolName() === "SIGINT") sigintPropAfter = info;
exportMapCache.search(bTs.path as Path, /*preferCapitalized*/ false, returnTrue, (info, symbolName) => {
if (symbolName === "SIGINT") sigintPropAfter = info;
});
assert.ok(sigintPropAfter);
assert.notEqual(symbolIdBefore, getSymbolId(sigintPropAfter![0].symbol));
@@ -0,0 +1,40 @@
//// [tests/cases/compiler/amdLikeInputDeclarationEmit.ts] ////
//// [typing.d.ts]
declare function define<T=unknown>(name: string, modules: string[], ready: (...modules: unknown[]) => T);
//// [BaseClass.d.ts]
declare module "deps/BaseClass" {
class BaseClass {
static extends<A>(a: A): new () => A & BaseClass;
}
export = BaseClass;
}
//// [ExtendedClass.js]
define("lib/ExtendedClass", ["deps/BaseClass"],
/**
* {typeof import("deps/BaseClass")}
* @param {typeof import("deps/BaseClass")} BaseClass
* @returns
*/
(BaseClass) => {
const ExtendedClass = BaseClass.extends({
f: function() {
return "something";
}
});
// Exports the module in a way tsc recognize class export
const module = {};
module.exports = ExtendedClass
return module.exports;
});
//// [ExtendedClass.d.ts]
/// <reference path="../tests/cases/compiler/deps/BaseClass.d.ts" />
export = ExtendedClass;
declare const ExtendedClass: new () => {
f: () => "something";
} & import("deps/BaseClass");
@@ -0,0 +1,66 @@
=== tests/cases/compiler/typing.d.ts ===
declare function define<T=unknown>(name: string, modules: string[], ready: (...modules: unknown[]) => T);
>define : Symbol(define, Decl(typing.d.ts, 0, 0))
>T : Symbol(T, Decl(typing.d.ts, 0, 24))
>name : Symbol(name, Decl(typing.d.ts, 0, 35))
>modules : Symbol(modules, Decl(typing.d.ts, 0, 48))
>ready : Symbol(ready, Decl(typing.d.ts, 0, 67))
>modules : Symbol(modules, Decl(typing.d.ts, 0, 76))
>T : Symbol(T, Decl(typing.d.ts, 0, 24))
=== tests/cases/compiler/deps/BaseClass.d.ts ===
declare module "deps/BaseClass" {
>"deps/BaseClass" : Symbol("deps/BaseClass", Decl(BaseClass.d.ts, 0, 0))
class BaseClass {
>BaseClass : Symbol(BaseClass, Decl(BaseClass.d.ts, 0, 33))
static extends<A>(a: A): new () => A & BaseClass;
>extends : Symbol(BaseClass.extends, Decl(BaseClass.d.ts, 1, 21))
>A : Symbol(A, Decl(BaseClass.d.ts, 2, 23))
>a : Symbol(a, Decl(BaseClass.d.ts, 2, 26))
>A : Symbol(A, Decl(BaseClass.d.ts, 2, 23))
>A : Symbol(A, Decl(BaseClass.d.ts, 2, 23))
>BaseClass : Symbol(BaseClass, Decl(BaseClass.d.ts, 0, 33))
}
export = BaseClass;
>BaseClass : Symbol(BaseClass, Decl(BaseClass.d.ts, 0, 33))
}
=== tests/cases/compiler/ExtendedClass.js ===
define("lib/ExtendedClass", ["deps/BaseClass"],
>define : Symbol(define, Decl(typing.d.ts, 0, 0))
/**
* {typeof import("deps/BaseClass")}
* @param {typeof import("deps/BaseClass")} BaseClass
* @returns
*/
(BaseClass) => {
>BaseClass : Symbol(BaseClass, Decl(ExtendedClass.js, 6, 1))
const ExtendedClass = BaseClass.extends({
>ExtendedClass : Symbol(ExtendedClass, Decl(ExtendedClass.js, 8, 9))
>BaseClass.extends : Symbol(BaseClass.extends, Decl(BaseClass.d.ts, 1, 21))
>BaseClass : Symbol(BaseClass, Decl(ExtendedClass.js, 6, 1))
>extends : Symbol(BaseClass.extends, Decl(BaseClass.d.ts, 1, 21))
f: function() {
>f : Symbol(f, Decl(ExtendedClass.js, 8, 45))
return "something";
}
});
// Exports the module in a way tsc recognize class export
const module = {};
>module : Symbol(module, Decl(ExtendedClass.js, 15, 9))
module.exports = ExtendedClass
>module : Symbol(export=, Decl(ExtendedClass.js, 15, 22))
>exports : Symbol(export=, Decl(ExtendedClass.js, 15, 22))
>ExtendedClass : Symbol(ExtendedClass, Decl(ExtendedClass.js, 8, 9))
return module.exports;
>module : Symbol(module, Decl(ExtendedClass.js, 15, 9))
});
@@ -0,0 +1,74 @@
=== tests/cases/compiler/typing.d.ts ===
declare function define<T=unknown>(name: string, modules: string[], ready: (...modules: unknown[]) => T);
>define : <T = unknown>(name: string, modules: string[], ready: (...modules: unknown[]) => T) => any
>name : string
>modules : string[]
>ready : (...modules: unknown[]) => T
>modules : unknown[]
=== tests/cases/compiler/deps/BaseClass.d.ts ===
declare module "deps/BaseClass" {
>"deps/BaseClass" : typeof import("deps/BaseClass")
class BaseClass {
>BaseClass : BaseClass
static extends<A>(a: A): new () => A & BaseClass;
>extends : <A>(a: A) => new () => A & BaseClass
>a : A
}
export = BaseClass;
>BaseClass : BaseClass
}
=== tests/cases/compiler/ExtendedClass.js ===
define("lib/ExtendedClass", ["deps/BaseClass"],
>define("lib/ExtendedClass", ["deps/BaseClass"], /** * {typeof import("deps/BaseClass")} * @param {typeof import("deps/BaseClass")} BaseClass * @returns */(BaseClass) => { const ExtendedClass = BaseClass.extends({ f: function() { return "something"; } }); // Exports the module in a way tsc recognize class export const module = {}; module.exports = ExtendedClass return module.exports;}) : any
>define : <T = unknown>(name: string, modules: string[], ready: (...modules: unknown[]) => T) => any
>"lib/ExtendedClass" : "lib/ExtendedClass"
>["deps/BaseClass"] : string[]
>"deps/BaseClass" : "deps/BaseClass"
/**
* {typeof import("deps/BaseClass")}
* @param {typeof import("deps/BaseClass")} BaseClass
* @returns
*/
(BaseClass) => {
>(BaseClass) => { const ExtendedClass = BaseClass.extends({ f: function() { return "something"; } }); // Exports the module in a way tsc recognize class export const module = {}; module.exports = ExtendedClass return module.exports;} : (BaseClass: typeof import("deps/BaseClass")) => any
>BaseClass : typeof import("deps/BaseClass")
const ExtendedClass = BaseClass.extends({
>ExtendedClass : new () => { f: () => "something"; } & import("deps/BaseClass")
>BaseClass.extends({ f: function() { return "something"; } }) : new () => { f: () => "something"; } & import("deps/BaseClass")
>BaseClass.extends : <A>(a: A) => new () => A & import("deps/BaseClass")
>BaseClass : typeof import("deps/BaseClass")
>extends : <A>(a: A) => new () => A & import("deps/BaseClass")
>{ f: function() { return "something"; } } : { f: () => "something"; }
f: function() {
>f : () => "something"
>function() { return "something"; } : () => "something"
return "something";
>"something" : "something"
}
});
// Exports the module in a way tsc recognize class export
const module = {};
>module : {}
>{} : {}
module.exports = ExtendedClass
>module.exports = ExtendedClass : any
>module.exports : any
>module : {}
>exports : any
>ExtendedClass : new () => { f: () => "something"; } & import("deps/BaseClass")
return module.exports;
>module.exports : any
>module : {}
>exports : any
});
+1 -1
View File
@@ -14,7 +14,7 @@ and limitations under the License.
***************************************************************************** */
declare namespace ts {
const versionMajorMinor = "4.6";
const versionMajorMinor = "4.7";
/** The version of the TypeScript compiler release */
const version: string;
/**
+1 -1
View File
@@ -14,7 +14,7 @@ and limitations under the License.
***************************************************************************** */
declare namespace ts {
const versionMajorMinor = "4.6";
const versionMajorMinor = "4.7";
/** The version of the TypeScript compiler release */
const version: string;
/**
@@ -0,0 +1,23 @@
tests/cases/conformance/jsdoc/0.js(14,20): error TS8024: JSDoc '@param' tag has name 's', but there is no parameter with that name.
==== tests/cases/conformance/jsdoc/0.js (1 errors) ====
// @ts-check
/**
* @param {number=} n
* @param {string} [s]
*/
var x = function foo(n, s) {}
var y;
/**
* @param {boolean!} b
*/
y = function bar(b) {}
/**
* @param {string} s
~
!!! error TS8024: JSDoc '@param' tag has name 's', but there is no parameter with that name.
*/
var one = function (s) { }, two = function (untyped) { };
@@ -0,0 +1,15 @@
=== tests/cases/conformance/jsdoc/test.js ===
/**
* @typedef {(a: string, b: number) => void} Foo
*/
class C {
>C : Symbol(C, Decl(test.js, 0, 0))
/** @type {Foo} */
foo(a, b) {}
>foo : Symbol(C.foo, Decl(test.js, 4, 9))
>a : Symbol(a, Decl(test.js, 6, 8))
>b : Symbol(b, Decl(test.js, 6, 10))
}
@@ -0,0 +1,15 @@
=== tests/cases/conformance/jsdoc/test.js ===
/**
* @typedef {(a: string, b: number) => void} Foo
*/
class C {
>C : C
/** @type {Foo} */
foo(a, b) {}
>foo : (a: string, b: number) => void
>a : string
>b : number
}
@@ -56,8 +56,8 @@ class D {
constructor() {
this[_a] = 0; // Error
}
static { _a = onInit; }
}
_a = onInit;
class E {
[onInit]() { } // Error
}
@@ -0,0 +1,73 @@
=== tests/cases/conformance/salsa/constructorFunctionMethodTypeParameters.js ===
/**
* @template {string} T
* @param {T} t
*/
function Cls(t) {
>Cls : Symbol(Cls, Decl(constructorFunctionMethodTypeParameters.js, 0, 0))
>t : Symbol(t, Decl(constructorFunctionMethodTypeParameters.js, 4, 13))
this.t = t;
>this.t : Symbol(Cls.t, Decl(constructorFunctionMethodTypeParameters.js, 4, 17))
>this : Symbol(Cls, Decl(constructorFunctionMethodTypeParameters.js, 0, 0))
>t : Symbol(Cls.t, Decl(constructorFunctionMethodTypeParameters.js, 4, 17))
>t : Symbol(t, Decl(constructorFunctionMethodTypeParameters.js, 4, 13))
}
/**
* @template {string} V
* @param {T} t
* @param {V} v
* @return {V}
*/
Cls.prototype.topLevelComment = function (t, v) {
>Cls.prototype : Symbol(Cls.topLevelComment, Decl(constructorFunctionMethodTypeParameters.js, 6, 1))
>Cls : Symbol(Cls, Decl(constructorFunctionMethodTypeParameters.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --))
>topLevelComment : Symbol(Cls.topLevelComment, Decl(constructorFunctionMethodTypeParameters.js, 6, 1))
>t : Symbol(t, Decl(constructorFunctionMethodTypeParameters.js, 14, 42))
>v : Symbol(v, Decl(constructorFunctionMethodTypeParameters.js, 14, 44))
return v
>v : Symbol(v, Decl(constructorFunctionMethodTypeParameters.js, 14, 44))
};
Cls.prototype.nestedComment =
>Cls.prototype : Symbol(Cls.nestedComment, Decl(constructorFunctionMethodTypeParameters.js, 16, 2))
>Cls : Symbol(Cls, Decl(constructorFunctionMethodTypeParameters.js, 0, 0))
>prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --))
>nestedComment : Symbol(Cls.nestedComment, Decl(constructorFunctionMethodTypeParameters.js, 16, 2))
/**
* @template {string} U
* @param {T} t
* @param {U} u
* @return {T}
*/
function (t, u) {
>t : Symbol(t, Decl(constructorFunctionMethodTypeParameters.js, 25, 14))
>u : Symbol(u, Decl(constructorFunctionMethodTypeParameters.js, 25, 16))
return t
>t : Symbol(t, Decl(constructorFunctionMethodTypeParameters.js, 25, 14))
};
var c = new Cls('a');
>c : Symbol(c, Decl(constructorFunctionMethodTypeParameters.js, 29, 3))
>Cls : Symbol(Cls, Decl(constructorFunctionMethodTypeParameters.js, 0, 0))
const s = c.topLevelComment('a', 'b');
>s : Symbol(s, Decl(constructorFunctionMethodTypeParameters.js, 30, 5))
>c.topLevelComment : Symbol(Cls.topLevelComment, Decl(constructorFunctionMethodTypeParameters.js, 6, 1))
>c : Symbol(c, Decl(constructorFunctionMethodTypeParameters.js, 29, 3))
>topLevelComment : Symbol(Cls.topLevelComment, Decl(constructorFunctionMethodTypeParameters.js, 6, 1))
const t = c.nestedComment('a', 'b');
>t : Symbol(t, Decl(constructorFunctionMethodTypeParameters.js, 31, 5))
>c.nestedComment : Symbol(Cls.nestedComment, Decl(constructorFunctionMethodTypeParameters.js, 16, 2))
>c : Symbol(c, Decl(constructorFunctionMethodTypeParameters.js, 29, 3))
>nestedComment : Symbol(Cls.nestedComment, Decl(constructorFunctionMethodTypeParameters.js, 16, 2))
@@ -0,0 +1,88 @@
=== tests/cases/conformance/salsa/constructorFunctionMethodTypeParameters.js ===
/**
* @template {string} T
* @param {T} t
*/
function Cls(t) {
>Cls : typeof Cls
>t : T
this.t = t;
>this.t = t : T
>this.t : any
>this : this
>t : any
>t : T
}
/**
* @template {string} V
* @param {T} t
* @param {V} v
* @return {V}
*/
Cls.prototype.topLevelComment = function (t, v) {
>Cls.prototype.topLevelComment = function (t, v) { return v} : <V extends string>(t: T, v: V) => V
>Cls.prototype.topLevelComment : any
>Cls.prototype : any
>Cls : typeof Cls
>prototype : any
>topLevelComment : any
>function (t, v) { return v} : <V extends string>(t: T, v: V) => V
>t : T
>v : V
return v
>v : V
};
Cls.prototype.nestedComment =
>Cls.prototype.nestedComment = /** * @template {string} U * @param {T} t * @param {U} u * @return {T} */ function (t, u) { return t } : <U extends string>(t: T, u: U) => T
>Cls.prototype.nestedComment : any
>Cls.prototype : any
>Cls : typeof Cls
>prototype : any
>nestedComment : any
/**
* @template {string} U
* @param {T} t
* @param {U} u
* @return {T}
*/
function (t, u) {
>function (t, u) { return t } : <U extends string>(t: T, u: U) => T
>t : T
>u : U
return t
>t : T
};
var c = new Cls('a');
>c : Cls<"a">
>new Cls('a') : Cls<"a">
>Cls : typeof Cls
>'a' : "a"
const s = c.topLevelComment('a', 'b');
>s : "b"
>c.topLevelComment('a', 'b') : "b"
>c.topLevelComment : <V extends string>(t: "a", v: V) => V
>c : Cls<"a">
>topLevelComment : <V extends string>(t: "a", v: V) => V
>'a' : "a"
>'b' : "b"
const t = c.nestedComment('a', 'b');
>t : "a"
>c.nestedComment('a', 'b') : "a"
>c.nestedComment : <U extends string>(t: "a", u: U) => "a"
>c : Cls<"a">
>nestedComment : <U extends string>(t: "a", u: U) => "a"
>'a' : "a"
>'b' : "b"
@@ -0,0 +1,108 @@
//// [divergentAccessorsTypes3.ts]
class One {
get prop1(): string { return ""; }
set prop1(s: string | number) { }
get prop2(): string { return ""; }
set prop2(s: string | number) { }
prop3: number;
get prop4(): string { return ""; }
set prop4(s: string | number) { }
}
class Two {
get prop1(): string { return ""; }
set prop1(s: string | number) { }
get prop2(): string { return ""; }
set prop2(s: string) { }
get prop3(): string { return ""; }
set prop3(s: string | boolean) { }
get prop4(): string { return ""; }
set prop4(s: string | boolean) { }
}
declare const u1: One|Two;
u1.prop1 = 42;
u1.prop1 = "hello";
u1.prop2 = 42;
u1.prop2 = "hello";
u1.prop3 = 42;
u1.prop3 = "hello";
u1.prop3 = true;
u1.prop4 = 42;
u1.prop4 = "hello";
u1.prop4 = true;
//// [divergentAccessorsTypes3.js]
var One = /** @class */ (function () {
function One() {
}
Object.defineProperty(One.prototype, "prop1", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
Object.defineProperty(One.prototype, "prop2", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
Object.defineProperty(One.prototype, "prop4", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
return One;
}());
var Two = /** @class */ (function () {
function Two() {
}
Object.defineProperty(Two.prototype, "prop1", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
Object.defineProperty(Two.prototype, "prop2", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
Object.defineProperty(Two.prototype, "prop3", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
Object.defineProperty(Two.prototype, "prop4", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
return Two;
}());
u1.prop1 = 42;
u1.prop1 = "hello";
u1.prop2 = 42;
u1.prop2 = "hello";
u1.prop3 = 42;
u1.prop3 = "hello";
u1.prop3 = true;
u1.prop4 = 42;
u1.prop4 = "hello";
u1.prop4 = true;
@@ -0,0 +1,116 @@
=== tests/cases/compiler/divergentAccessorsTypes3.ts ===
class One {
>One : Symbol(One, Decl(divergentAccessorsTypes3.ts, 0, 0))
get prop1(): string { return ""; }
>prop1 : Symbol(One.prop1, Decl(divergentAccessorsTypes3.ts, 0, 11), Decl(divergentAccessorsTypes3.ts, 1, 36))
set prop1(s: string | number) { }
>prop1 : Symbol(One.prop1, Decl(divergentAccessorsTypes3.ts, 0, 11), Decl(divergentAccessorsTypes3.ts, 1, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes3.ts, 2, 12))
get prop2(): string { return ""; }
>prop2 : Symbol(One.prop2, Decl(divergentAccessorsTypes3.ts, 2, 35), Decl(divergentAccessorsTypes3.ts, 4, 36))
set prop2(s: string | number) { }
>prop2 : Symbol(One.prop2, Decl(divergentAccessorsTypes3.ts, 2, 35), Decl(divergentAccessorsTypes3.ts, 4, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes3.ts, 5, 12))
prop3: number;
>prop3 : Symbol(One.prop3, Decl(divergentAccessorsTypes3.ts, 5, 35))
get prop4(): string { return ""; }
>prop4 : Symbol(One.prop4, Decl(divergentAccessorsTypes3.ts, 7, 16), Decl(divergentAccessorsTypes3.ts, 9, 36))
set prop4(s: string | number) { }
>prop4 : Symbol(One.prop4, Decl(divergentAccessorsTypes3.ts, 7, 16), Decl(divergentAccessorsTypes3.ts, 9, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes3.ts, 10, 12))
}
class Two {
>Two : Symbol(Two, Decl(divergentAccessorsTypes3.ts, 11, 1))
get prop1(): string { return ""; }
>prop1 : Symbol(Two.prop1, Decl(divergentAccessorsTypes3.ts, 13, 11), Decl(divergentAccessorsTypes3.ts, 14, 36))
set prop1(s: string | number) { }
>prop1 : Symbol(Two.prop1, Decl(divergentAccessorsTypes3.ts, 13, 11), Decl(divergentAccessorsTypes3.ts, 14, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes3.ts, 15, 12))
get prop2(): string { return ""; }
>prop2 : Symbol(Two.prop2, Decl(divergentAccessorsTypes3.ts, 15, 35), Decl(divergentAccessorsTypes3.ts, 17, 36))
set prop2(s: string) { }
>prop2 : Symbol(Two.prop2, Decl(divergentAccessorsTypes3.ts, 15, 35), Decl(divergentAccessorsTypes3.ts, 17, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes3.ts, 18, 12))
get prop3(): string { return ""; }
>prop3 : Symbol(Two.prop3, Decl(divergentAccessorsTypes3.ts, 18, 26), Decl(divergentAccessorsTypes3.ts, 20, 36))
set prop3(s: string | boolean) { }
>prop3 : Symbol(Two.prop3, Decl(divergentAccessorsTypes3.ts, 18, 26), Decl(divergentAccessorsTypes3.ts, 20, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes3.ts, 21, 12))
get prop4(): string { return ""; }
>prop4 : Symbol(Two.prop4, Decl(divergentAccessorsTypes3.ts, 21, 36), Decl(divergentAccessorsTypes3.ts, 23, 36))
set prop4(s: string | boolean) { }
>prop4 : Symbol(Two.prop4, Decl(divergentAccessorsTypes3.ts, 21, 36), Decl(divergentAccessorsTypes3.ts, 23, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes3.ts, 24, 12))
}
declare const u1: One|Two;
>u1 : Symbol(u1, Decl(divergentAccessorsTypes3.ts, 27, 13))
>One : Symbol(One, Decl(divergentAccessorsTypes3.ts, 0, 0))
>Two : Symbol(Two, Decl(divergentAccessorsTypes3.ts, 11, 1))
u1.prop1 = 42;
>u1.prop1 : Symbol(prop1, Decl(divergentAccessorsTypes3.ts, 0, 11), Decl(divergentAccessorsTypes3.ts, 1, 36), Decl(divergentAccessorsTypes3.ts, 13, 11), Decl(divergentAccessorsTypes3.ts, 14, 36))
>u1 : Symbol(u1, Decl(divergentAccessorsTypes3.ts, 27, 13))
>prop1 : Symbol(prop1, Decl(divergentAccessorsTypes3.ts, 0, 11), Decl(divergentAccessorsTypes3.ts, 1, 36), Decl(divergentAccessorsTypes3.ts, 13, 11), Decl(divergentAccessorsTypes3.ts, 14, 36))
u1.prop1 = "hello";
>u1.prop1 : Symbol(prop1, Decl(divergentAccessorsTypes3.ts, 0, 11), Decl(divergentAccessorsTypes3.ts, 1, 36), Decl(divergentAccessorsTypes3.ts, 13, 11), Decl(divergentAccessorsTypes3.ts, 14, 36))
>u1 : Symbol(u1, Decl(divergentAccessorsTypes3.ts, 27, 13))
>prop1 : Symbol(prop1, Decl(divergentAccessorsTypes3.ts, 0, 11), Decl(divergentAccessorsTypes3.ts, 1, 36), Decl(divergentAccessorsTypes3.ts, 13, 11), Decl(divergentAccessorsTypes3.ts, 14, 36))
u1.prop2 = 42;
>u1.prop2 : Symbol(prop2, Decl(divergentAccessorsTypes3.ts, 2, 35), Decl(divergentAccessorsTypes3.ts, 4, 36), Decl(divergentAccessorsTypes3.ts, 15, 35), Decl(divergentAccessorsTypes3.ts, 17, 36))
>u1 : Symbol(u1, Decl(divergentAccessorsTypes3.ts, 27, 13))
>prop2 : Symbol(prop2, Decl(divergentAccessorsTypes3.ts, 2, 35), Decl(divergentAccessorsTypes3.ts, 4, 36), Decl(divergentAccessorsTypes3.ts, 15, 35), Decl(divergentAccessorsTypes3.ts, 17, 36))
u1.prop2 = "hello";
>u1.prop2 : Symbol(prop2, Decl(divergentAccessorsTypes3.ts, 2, 35), Decl(divergentAccessorsTypes3.ts, 4, 36), Decl(divergentAccessorsTypes3.ts, 15, 35), Decl(divergentAccessorsTypes3.ts, 17, 36))
>u1 : Symbol(u1, Decl(divergentAccessorsTypes3.ts, 27, 13))
>prop2 : Symbol(prop2, Decl(divergentAccessorsTypes3.ts, 2, 35), Decl(divergentAccessorsTypes3.ts, 4, 36), Decl(divergentAccessorsTypes3.ts, 15, 35), Decl(divergentAccessorsTypes3.ts, 17, 36))
u1.prop3 = 42;
>u1.prop3 : Symbol(prop3, Decl(divergentAccessorsTypes3.ts, 5, 35), Decl(divergentAccessorsTypes3.ts, 18, 26), Decl(divergentAccessorsTypes3.ts, 20, 36))
>u1 : Symbol(u1, Decl(divergentAccessorsTypes3.ts, 27, 13))
>prop3 : Symbol(prop3, Decl(divergentAccessorsTypes3.ts, 5, 35), Decl(divergentAccessorsTypes3.ts, 18, 26), Decl(divergentAccessorsTypes3.ts, 20, 36))
u1.prop3 = "hello";
>u1.prop3 : Symbol(prop3, Decl(divergentAccessorsTypes3.ts, 5, 35), Decl(divergentAccessorsTypes3.ts, 18, 26), Decl(divergentAccessorsTypes3.ts, 20, 36))
>u1 : Symbol(u1, Decl(divergentAccessorsTypes3.ts, 27, 13))
>prop3 : Symbol(prop3, Decl(divergentAccessorsTypes3.ts, 5, 35), Decl(divergentAccessorsTypes3.ts, 18, 26), Decl(divergentAccessorsTypes3.ts, 20, 36))
u1.prop3 = true;
>u1.prop3 : Symbol(prop3, Decl(divergentAccessorsTypes3.ts, 5, 35), Decl(divergentAccessorsTypes3.ts, 18, 26), Decl(divergentAccessorsTypes3.ts, 20, 36))
>u1 : Symbol(u1, Decl(divergentAccessorsTypes3.ts, 27, 13))
>prop3 : Symbol(prop3, Decl(divergentAccessorsTypes3.ts, 5, 35), Decl(divergentAccessorsTypes3.ts, 18, 26), Decl(divergentAccessorsTypes3.ts, 20, 36))
u1.prop4 = 42;
>u1.prop4 : Symbol(prop4, Decl(divergentAccessorsTypes3.ts, 7, 16), Decl(divergentAccessorsTypes3.ts, 9, 36), Decl(divergentAccessorsTypes3.ts, 21, 36), Decl(divergentAccessorsTypes3.ts, 23, 36))
>u1 : Symbol(u1, Decl(divergentAccessorsTypes3.ts, 27, 13))
>prop4 : Symbol(prop4, Decl(divergentAccessorsTypes3.ts, 7, 16), Decl(divergentAccessorsTypes3.ts, 9, 36), Decl(divergentAccessorsTypes3.ts, 21, 36), Decl(divergentAccessorsTypes3.ts, 23, 36))
u1.prop4 = "hello";
>u1.prop4 : Symbol(prop4, Decl(divergentAccessorsTypes3.ts, 7, 16), Decl(divergentAccessorsTypes3.ts, 9, 36), Decl(divergentAccessorsTypes3.ts, 21, 36), Decl(divergentAccessorsTypes3.ts, 23, 36))
>u1 : Symbol(u1, Decl(divergentAccessorsTypes3.ts, 27, 13))
>prop4 : Symbol(prop4, Decl(divergentAccessorsTypes3.ts, 7, 16), Decl(divergentAccessorsTypes3.ts, 9, 36), Decl(divergentAccessorsTypes3.ts, 21, 36), Decl(divergentAccessorsTypes3.ts, 23, 36))
u1.prop4 = true;
>u1.prop4 : Symbol(prop4, Decl(divergentAccessorsTypes3.ts, 7, 16), Decl(divergentAccessorsTypes3.ts, 9, 36), Decl(divergentAccessorsTypes3.ts, 21, 36), Decl(divergentAccessorsTypes3.ts, 23, 36))
>u1 : Symbol(u1, Decl(divergentAccessorsTypes3.ts, 27, 13))
>prop4 : Symbol(prop4, Decl(divergentAccessorsTypes3.ts, 7, 16), Decl(divergentAccessorsTypes3.ts, 9, 36), Decl(divergentAccessorsTypes3.ts, 21, 36), Decl(divergentAccessorsTypes3.ts, 23, 36))
@@ -0,0 +1,141 @@
=== tests/cases/compiler/divergentAccessorsTypes3.ts ===
class One {
>One : One
get prop1(): string { return ""; }
>prop1 : string
>"" : ""
set prop1(s: string | number) { }
>prop1 : string
>s : string | number
get prop2(): string { return ""; }
>prop2 : string
>"" : ""
set prop2(s: string | number) { }
>prop2 : string
>s : string | number
prop3: number;
>prop3 : number
get prop4(): string { return ""; }
>prop4 : string
>"" : ""
set prop4(s: string | number) { }
>prop4 : string
>s : string | number
}
class Two {
>Two : Two
get prop1(): string { return ""; }
>prop1 : string
>"" : ""
set prop1(s: string | number) { }
>prop1 : string
>s : string | number
get prop2(): string { return ""; }
>prop2 : string
>"" : ""
set prop2(s: string) { }
>prop2 : string
>s : string
get prop3(): string { return ""; }
>prop3 : string
>"" : ""
set prop3(s: string | boolean) { }
>prop3 : string
>s : string | boolean
get prop4(): string { return ""; }
>prop4 : string
>"" : ""
set prop4(s: string | boolean) { }
>prop4 : string
>s : string | boolean
}
declare const u1: One|Two;
>u1 : One | Two
u1.prop1 = 42;
>u1.prop1 = 42 : 42
>u1.prop1 : string | number
>u1 : One | Two
>prop1 : string | number
>42 : 42
u1.prop1 = "hello";
>u1.prop1 = "hello" : "hello"
>u1.prop1 : string | number
>u1 : One | Two
>prop1 : string | number
>"hello" : "hello"
u1.prop2 = 42;
>u1.prop2 = 42 : 42
>u1.prop2 : string | number
>u1 : One | Two
>prop2 : string | number
>42 : 42
u1.prop2 = "hello";
>u1.prop2 = "hello" : "hello"
>u1.prop2 : string | number
>u1 : One | Two
>prop2 : string | number
>"hello" : "hello"
u1.prop3 = 42;
>u1.prop3 = 42 : 42
>u1.prop3 : string | number | boolean
>u1 : One | Two
>prop3 : string | number | boolean
>42 : 42
u1.prop3 = "hello";
>u1.prop3 = "hello" : "hello"
>u1.prop3 : string | number | boolean
>u1 : One | Two
>prop3 : string | number | boolean
>"hello" : "hello"
u1.prop3 = true;
>u1.prop3 = true : true
>u1.prop3 : string | number | boolean
>u1 : One | Two
>prop3 : string | number | boolean
>true : true
u1.prop4 = 42;
>u1.prop4 = 42 : 42
>u1.prop4 : string | number | boolean
>u1 : One | Two
>prop4 : string | number | boolean
>42 : 42
u1.prop4 = "hello";
>u1.prop4 = "hello" : "hello"
>u1.prop4 : string | number | boolean
>u1 : One | Two
>prop4 : string | number | boolean
>"hello" : "hello"
u1.prop4 = true;
>u1.prop4 = true : true
>u1.prop4 : string | number | boolean
>u1 : One | Two
>prop4 : string | number | boolean
>true : true
@@ -0,0 +1,36 @@
tests/cases/compiler/divergentAccessorsTypes4.ts(29,1): error TS2322: Type '"hello"' is not assignable to type '42'.
==== tests/cases/compiler/divergentAccessorsTypes4.ts (1 errors) ====
class One {
get prop1(): string { return ""; }
set prop1(s: string | number) { }
prop2: number;
}
class Two {
get prop1(): "hello" { return "hello"; }
set prop1(s: "hello" | number) { }
get prop2(): string { return ""; }
set prop2(s: string | 42) { }
}
declare const i: One & Two;
// "hello"
i.prop1;
// number | "hello"
i.prop1 = 42;
i.prop1 = "hello";
// never
i.prop2;
// 42
i.prop2 = 42;
i.prop2 = "hello"; // error
~~~~~~~
!!! error TS2322: Type '"hello"' is not assignable to type '42'.
@@ -0,0 +1,71 @@
//// [divergentAccessorsTypes4.ts]
class One {
get prop1(): string { return ""; }
set prop1(s: string | number) { }
prop2: number;
}
class Two {
get prop1(): "hello" { return "hello"; }
set prop1(s: "hello" | number) { }
get prop2(): string { return ""; }
set prop2(s: string | 42) { }
}
declare const i: One & Two;
// "hello"
i.prop1;
// number | "hello"
i.prop1 = 42;
i.prop1 = "hello";
// never
i.prop2;
// 42
i.prop2 = 42;
i.prop2 = "hello"; // error
//// [divergentAccessorsTypes4.js]
var One = /** @class */ (function () {
function One() {
}
Object.defineProperty(One.prototype, "prop1", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
return One;
}());
var Two = /** @class */ (function () {
function Two() {
}
Object.defineProperty(Two.prototype, "prop1", {
get: function () { return "hello"; },
set: function (s) { },
enumerable: false,
configurable: true
});
Object.defineProperty(Two.prototype, "prop2", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
return Two;
}());
// "hello"
i.prop1;
// number | "hello"
i.prop1 = 42;
i.prop1 = "hello";
// never
i.prop2;
// 42
i.prop2 = 42;
i.prop2 = "hello"; // error
@@ -0,0 +1,73 @@
=== tests/cases/compiler/divergentAccessorsTypes4.ts ===
class One {
>One : Symbol(One, Decl(divergentAccessorsTypes4.ts, 0, 0))
get prop1(): string { return ""; }
>prop1 : Symbol(One.prop1, Decl(divergentAccessorsTypes4.ts, 0, 11), Decl(divergentAccessorsTypes4.ts, 1, 36))
set prop1(s: string | number) { }
>prop1 : Symbol(One.prop1, Decl(divergentAccessorsTypes4.ts, 0, 11), Decl(divergentAccessorsTypes4.ts, 1, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes4.ts, 2, 12))
prop2: number;
>prop2 : Symbol(One.prop2, Decl(divergentAccessorsTypes4.ts, 2, 35))
}
class Two {
>Two : Symbol(Two, Decl(divergentAccessorsTypes4.ts, 5, 1))
get prop1(): "hello" { return "hello"; }
>prop1 : Symbol(Two.prop1, Decl(divergentAccessorsTypes4.ts, 7, 11), Decl(divergentAccessorsTypes4.ts, 8, 42))
set prop1(s: "hello" | number) { }
>prop1 : Symbol(Two.prop1, Decl(divergentAccessorsTypes4.ts, 7, 11), Decl(divergentAccessorsTypes4.ts, 8, 42))
>s : Symbol(s, Decl(divergentAccessorsTypes4.ts, 9, 12))
get prop2(): string { return ""; }
>prop2 : Symbol(Two.prop2, Decl(divergentAccessorsTypes4.ts, 9, 36), Decl(divergentAccessorsTypes4.ts, 11, 36))
set prop2(s: string | 42) { }
>prop2 : Symbol(Two.prop2, Decl(divergentAccessorsTypes4.ts, 9, 36), Decl(divergentAccessorsTypes4.ts, 11, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes4.ts, 12, 12))
}
declare const i: One & Two;
>i : Symbol(i, Decl(divergentAccessorsTypes4.ts, 16, 13))
>One : Symbol(One, Decl(divergentAccessorsTypes4.ts, 0, 0))
>Two : Symbol(Two, Decl(divergentAccessorsTypes4.ts, 5, 1))
// "hello"
i.prop1;
>i.prop1 : Symbol(prop1, Decl(divergentAccessorsTypes4.ts, 0, 11), Decl(divergentAccessorsTypes4.ts, 1, 36), Decl(divergentAccessorsTypes4.ts, 7, 11), Decl(divergentAccessorsTypes4.ts, 8, 42))
>i : Symbol(i, Decl(divergentAccessorsTypes4.ts, 16, 13))
>prop1 : Symbol(prop1, Decl(divergentAccessorsTypes4.ts, 0, 11), Decl(divergentAccessorsTypes4.ts, 1, 36), Decl(divergentAccessorsTypes4.ts, 7, 11), Decl(divergentAccessorsTypes4.ts, 8, 42))
// number | "hello"
i.prop1 = 42;
>i.prop1 : Symbol(prop1, Decl(divergentAccessorsTypes4.ts, 0, 11), Decl(divergentAccessorsTypes4.ts, 1, 36), Decl(divergentAccessorsTypes4.ts, 7, 11), Decl(divergentAccessorsTypes4.ts, 8, 42))
>i : Symbol(i, Decl(divergentAccessorsTypes4.ts, 16, 13))
>prop1 : Symbol(prop1, Decl(divergentAccessorsTypes4.ts, 0, 11), Decl(divergentAccessorsTypes4.ts, 1, 36), Decl(divergentAccessorsTypes4.ts, 7, 11), Decl(divergentAccessorsTypes4.ts, 8, 42))
i.prop1 = "hello";
>i.prop1 : Symbol(prop1, Decl(divergentAccessorsTypes4.ts, 0, 11), Decl(divergentAccessorsTypes4.ts, 1, 36), Decl(divergentAccessorsTypes4.ts, 7, 11), Decl(divergentAccessorsTypes4.ts, 8, 42))
>i : Symbol(i, Decl(divergentAccessorsTypes4.ts, 16, 13))
>prop1 : Symbol(prop1, Decl(divergentAccessorsTypes4.ts, 0, 11), Decl(divergentAccessorsTypes4.ts, 1, 36), Decl(divergentAccessorsTypes4.ts, 7, 11), Decl(divergentAccessorsTypes4.ts, 8, 42))
// never
i.prop2;
>i.prop2 : Symbol(prop2, Decl(divergentAccessorsTypes4.ts, 2, 35), Decl(divergentAccessorsTypes4.ts, 9, 36), Decl(divergentAccessorsTypes4.ts, 11, 36))
>i : Symbol(i, Decl(divergentAccessorsTypes4.ts, 16, 13))
>prop2 : Symbol(prop2, Decl(divergentAccessorsTypes4.ts, 2, 35), Decl(divergentAccessorsTypes4.ts, 9, 36), Decl(divergentAccessorsTypes4.ts, 11, 36))
// 42
i.prop2 = 42;
>i.prop2 : Symbol(prop2, Decl(divergentAccessorsTypes4.ts, 2, 35), Decl(divergentAccessorsTypes4.ts, 9, 36), Decl(divergentAccessorsTypes4.ts, 11, 36))
>i : Symbol(i, Decl(divergentAccessorsTypes4.ts, 16, 13))
>prop2 : Symbol(prop2, Decl(divergentAccessorsTypes4.ts, 2, 35), Decl(divergentAccessorsTypes4.ts, 9, 36), Decl(divergentAccessorsTypes4.ts, 11, 36))
i.prop2 = "hello"; // error
>i.prop2 : Symbol(prop2, Decl(divergentAccessorsTypes4.ts, 2, 35), Decl(divergentAccessorsTypes4.ts, 9, 36), Decl(divergentAccessorsTypes4.ts, 11, 36))
>i : Symbol(i, Decl(divergentAccessorsTypes4.ts, 16, 13))
>prop2 : Symbol(prop2, Decl(divergentAccessorsTypes4.ts, 2, 35), Decl(divergentAccessorsTypes4.ts, 9, 36), Decl(divergentAccessorsTypes4.ts, 11, 36))
@@ -0,0 +1,82 @@
=== tests/cases/compiler/divergentAccessorsTypes4.ts ===
class One {
>One : One
get prop1(): string { return ""; }
>prop1 : string
>"" : ""
set prop1(s: string | number) { }
>prop1 : string
>s : string | number
prop2: number;
>prop2 : number
}
class Two {
>Two : Two
get prop1(): "hello" { return "hello"; }
>prop1 : "hello"
>"hello" : "hello"
set prop1(s: "hello" | number) { }
>prop1 : "hello"
>s : number | "hello"
get prop2(): string { return ""; }
>prop2 : string
>"" : ""
set prop2(s: string | 42) { }
>prop2 : string
>s : string | 42
}
declare const i: One & Two;
>i : One & Two
// "hello"
i.prop1;
>i.prop1 : "hello"
>i : One & Two
>prop1 : "hello"
// number | "hello"
i.prop1 = 42;
>i.prop1 = 42 : 42
>i.prop1 : number | "hello"
>i : One & Two
>prop1 : number | "hello"
>42 : 42
i.prop1 = "hello";
>i.prop1 = "hello" : "hello"
>i.prop1 : number | "hello"
>i : One & Two
>prop1 : number | "hello"
>"hello" : "hello"
// never
i.prop2;
>i.prop2 : never
>i : One & Two
>prop2 : never
// 42
i.prop2 = 42;
>i.prop2 = 42 : 42
>i.prop2 : 42
>i : One & Two
>prop2 : 42
>42 : 42
i.prop2 = "hello"; // error
>i.prop2 = "hello" : "hello"
>i.prop2 : 42
>i : One & Two
>prop2 : 42
>"hello" : "hello"
@@ -0,0 +1,46 @@
tests/cases/compiler/divergentAccessorsTypes5.ts(31,1): error TS2322: Type '42' is not assignable to type '"hello"'.
tests/cases/compiler/divergentAccessorsTypes5.ts(36,1): error TS2322: Type '"hello"' is not assignable to type '42'.
==== tests/cases/compiler/divergentAccessorsTypes5.ts (2 errors) ====
// Not really different from divergentAccessorsTypes4.ts,
// but goes through the deferred type code
class One {
get prop1(): string { return ""; }
set prop1(s: string | number) { }
prop2: number;
}
class Two {
get prop1(): "hello" { return "hello"; }
set prop1(s: "hello" | number) { }
get prop2(): string { return ""; }
set prop2(s: string | 42) { }
}
class Three {
get prop1(): "hello" { return "hello"; }
set prop1(s: "hello" | boolean) { }
get prop2(): string { return ""; }
set prop2(s: string | number | boolean) { }
}
declare const i: One & Two & Three;
// "hello"
i.prop1 = 42; // error
~~~~~~~
!!! error TS2322: Type '42' is not assignable to type '"hello"'.
i.prop1 = "hello";
// 42
i.prop2 = 42;
i.prop2 = "hello"; // error
~~~~~~~
!!! error TS2322: Type '"hello"' is not assignable to type '42'.
@@ -0,0 +1,93 @@
//// [divergentAccessorsTypes5.ts]
// Not really different from divergentAccessorsTypes4.ts,
// but goes through the deferred type code
class One {
get prop1(): string { return ""; }
set prop1(s: string | number) { }
prop2: number;
}
class Two {
get prop1(): "hello" { return "hello"; }
set prop1(s: "hello" | number) { }
get prop2(): string { return ""; }
set prop2(s: string | 42) { }
}
class Three {
get prop1(): "hello" { return "hello"; }
set prop1(s: "hello" | boolean) { }
get prop2(): string { return ""; }
set prop2(s: string | number | boolean) { }
}
declare const i: One & Two & Three;
// "hello"
i.prop1 = 42; // error
i.prop1 = "hello";
// 42
i.prop2 = 42;
i.prop2 = "hello"; // error
//// [divergentAccessorsTypes5.js]
// Not really different from divergentAccessorsTypes4.ts,
// but goes through the deferred type code
var One = /** @class */ (function () {
function One() {
}
Object.defineProperty(One.prototype, "prop1", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
return One;
}());
var Two = /** @class */ (function () {
function Two() {
}
Object.defineProperty(Two.prototype, "prop1", {
get: function () { return "hello"; },
set: function (s) { },
enumerable: false,
configurable: true
});
Object.defineProperty(Two.prototype, "prop2", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
return Two;
}());
var Three = /** @class */ (function () {
function Three() {
}
Object.defineProperty(Three.prototype, "prop1", {
get: function () { return "hello"; },
set: function (s) { },
enumerable: false,
configurable: true
});
Object.defineProperty(Three.prototype, "prop2", {
get: function () { return ""; },
set: function (s) { },
enumerable: false,
configurable: true
});
return Three;
}());
// "hello"
i.prop1 = 42; // error
i.prop1 = "hello";
// 42
i.prop2 = 42;
i.prop2 = "hello"; // error
@@ -0,0 +1,83 @@
=== tests/cases/compiler/divergentAccessorsTypes5.ts ===
// Not really different from divergentAccessorsTypes4.ts,
// but goes through the deferred type code
class One {
>One : Symbol(One, Decl(divergentAccessorsTypes5.ts, 0, 0))
get prop1(): string { return ""; }
>prop1 : Symbol(One.prop1, Decl(divergentAccessorsTypes5.ts, 3, 11), Decl(divergentAccessorsTypes5.ts, 4, 36))
set prop1(s: string | number) { }
>prop1 : Symbol(One.prop1, Decl(divergentAccessorsTypes5.ts, 3, 11), Decl(divergentAccessorsTypes5.ts, 4, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes5.ts, 5, 12))
prop2: number;
>prop2 : Symbol(One.prop2, Decl(divergentAccessorsTypes5.ts, 5, 35))
}
class Two {
>Two : Symbol(Two, Decl(divergentAccessorsTypes5.ts, 8, 1))
get prop1(): "hello" { return "hello"; }
>prop1 : Symbol(Two.prop1, Decl(divergentAccessorsTypes5.ts, 10, 11), Decl(divergentAccessorsTypes5.ts, 11, 42))
set prop1(s: "hello" | number) { }
>prop1 : Symbol(Two.prop1, Decl(divergentAccessorsTypes5.ts, 10, 11), Decl(divergentAccessorsTypes5.ts, 11, 42))
>s : Symbol(s, Decl(divergentAccessorsTypes5.ts, 12, 12))
get prop2(): string { return ""; }
>prop2 : Symbol(Two.prop2, Decl(divergentAccessorsTypes5.ts, 12, 36), Decl(divergentAccessorsTypes5.ts, 14, 36))
set prop2(s: string | 42) { }
>prop2 : Symbol(Two.prop2, Decl(divergentAccessorsTypes5.ts, 12, 36), Decl(divergentAccessorsTypes5.ts, 14, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes5.ts, 15, 12))
}
class Three {
>Three : Symbol(Three, Decl(divergentAccessorsTypes5.ts, 17, 1))
get prop1(): "hello" { return "hello"; }
>prop1 : Symbol(Three.prop1, Decl(divergentAccessorsTypes5.ts, 19, 13), Decl(divergentAccessorsTypes5.ts, 20, 42))
set prop1(s: "hello" | boolean) { }
>prop1 : Symbol(Three.prop1, Decl(divergentAccessorsTypes5.ts, 19, 13), Decl(divergentAccessorsTypes5.ts, 20, 42))
>s : Symbol(s, Decl(divergentAccessorsTypes5.ts, 21, 12))
get prop2(): string { return ""; }
>prop2 : Symbol(Three.prop2, Decl(divergentAccessorsTypes5.ts, 21, 37), Decl(divergentAccessorsTypes5.ts, 23, 36))
set prop2(s: string | number | boolean) { }
>prop2 : Symbol(Three.prop2, Decl(divergentAccessorsTypes5.ts, 21, 37), Decl(divergentAccessorsTypes5.ts, 23, 36))
>s : Symbol(s, Decl(divergentAccessorsTypes5.ts, 24, 12))
}
declare const i: One & Two & Three;
>i : Symbol(i, Decl(divergentAccessorsTypes5.ts, 27, 13))
>One : Symbol(One, Decl(divergentAccessorsTypes5.ts, 0, 0))
>Two : Symbol(Two, Decl(divergentAccessorsTypes5.ts, 8, 1))
>Three : Symbol(Three, Decl(divergentAccessorsTypes5.ts, 17, 1))
// "hello"
i.prop1 = 42; // error
>i.prop1 : Symbol(prop1, Decl(divergentAccessorsTypes5.ts, 3, 11), Decl(divergentAccessorsTypes5.ts, 4, 36), Decl(divergentAccessorsTypes5.ts, 10, 11), Decl(divergentAccessorsTypes5.ts, 11, 42), Decl(divergentAccessorsTypes5.ts, 19, 13) ... and 1 more)
>i : Symbol(i, Decl(divergentAccessorsTypes5.ts, 27, 13))
>prop1 : Symbol(prop1, Decl(divergentAccessorsTypes5.ts, 3, 11), Decl(divergentAccessorsTypes5.ts, 4, 36), Decl(divergentAccessorsTypes5.ts, 10, 11), Decl(divergentAccessorsTypes5.ts, 11, 42), Decl(divergentAccessorsTypes5.ts, 19, 13) ... and 1 more)
i.prop1 = "hello";
>i.prop1 : Symbol(prop1, Decl(divergentAccessorsTypes5.ts, 3, 11), Decl(divergentAccessorsTypes5.ts, 4, 36), Decl(divergentAccessorsTypes5.ts, 10, 11), Decl(divergentAccessorsTypes5.ts, 11, 42), Decl(divergentAccessorsTypes5.ts, 19, 13) ... and 1 more)
>i : Symbol(i, Decl(divergentAccessorsTypes5.ts, 27, 13))
>prop1 : Symbol(prop1, Decl(divergentAccessorsTypes5.ts, 3, 11), Decl(divergentAccessorsTypes5.ts, 4, 36), Decl(divergentAccessorsTypes5.ts, 10, 11), Decl(divergentAccessorsTypes5.ts, 11, 42), Decl(divergentAccessorsTypes5.ts, 19, 13) ... and 1 more)
// 42
i.prop2 = 42;
>i.prop2 : Symbol(prop2, Decl(divergentAccessorsTypes5.ts, 5, 35), Decl(divergentAccessorsTypes5.ts, 12, 36), Decl(divergentAccessorsTypes5.ts, 14, 36), Decl(divergentAccessorsTypes5.ts, 21, 37), Decl(divergentAccessorsTypes5.ts, 23, 36))
>i : Symbol(i, Decl(divergentAccessorsTypes5.ts, 27, 13))
>prop2 : Symbol(prop2, Decl(divergentAccessorsTypes5.ts, 5, 35), Decl(divergentAccessorsTypes5.ts, 12, 36), Decl(divergentAccessorsTypes5.ts, 14, 36), Decl(divergentAccessorsTypes5.ts, 21, 37), Decl(divergentAccessorsTypes5.ts, 23, 36))
i.prop2 = "hello"; // error
>i.prop2 : Symbol(prop2, Decl(divergentAccessorsTypes5.ts, 5, 35), Decl(divergentAccessorsTypes5.ts, 12, 36), Decl(divergentAccessorsTypes5.ts, 14, 36), Decl(divergentAccessorsTypes5.ts, 21, 37), Decl(divergentAccessorsTypes5.ts, 23, 36))
>i : Symbol(i, Decl(divergentAccessorsTypes5.ts, 27, 13))
>prop2 : Symbol(prop2, Decl(divergentAccessorsTypes5.ts, 5, 35), Decl(divergentAccessorsTypes5.ts, 12, 36), Decl(divergentAccessorsTypes5.ts, 14, 36), Decl(divergentAccessorsTypes5.ts, 21, 37), Decl(divergentAccessorsTypes5.ts, 23, 36))
@@ -0,0 +1,93 @@
=== tests/cases/compiler/divergentAccessorsTypes5.ts ===
// Not really different from divergentAccessorsTypes4.ts,
// but goes through the deferred type code
class One {
>One : One
get prop1(): string { return ""; }
>prop1 : string
>"" : ""
set prop1(s: string | number) { }
>prop1 : string
>s : string | number
prop2: number;
>prop2 : number
}
class Two {
>Two : Two
get prop1(): "hello" { return "hello"; }
>prop1 : "hello"
>"hello" : "hello"
set prop1(s: "hello" | number) { }
>prop1 : "hello"
>s : number | "hello"
get prop2(): string { return ""; }
>prop2 : string
>"" : ""
set prop2(s: string | 42) { }
>prop2 : string
>s : string | 42
}
class Three {
>Three : Three
get prop1(): "hello" { return "hello"; }
>prop1 : "hello"
>"hello" : "hello"
set prop1(s: "hello" | boolean) { }
>prop1 : "hello"
>s : boolean | "hello"
get prop2(): string { return ""; }
>prop2 : string
>"" : ""
set prop2(s: string | number | boolean) { }
>prop2 : string
>s : string | number | boolean
}
declare const i: One & Two & Three;
>i : One & Two & Three
// "hello"
i.prop1 = 42; // error
>i.prop1 = 42 : 42
>i.prop1 : "hello"
>i : One & Two & Three
>prop1 : "hello"
>42 : 42
i.prop1 = "hello";
>i.prop1 = "hello" : "hello"
>i.prop1 : "hello"
>i : One & Two & Three
>prop1 : "hello"
>"hello" : "hello"
// 42
i.prop2 = 42;
>i.prop2 = 42 : 42
>i.prop2 : 42
>i : One & Two & Three
>prop2 : 42
>42 : 42
i.prop2 = "hello"; // error
>i.prop2 = "hello" : "hello"
>i.prop2 : 42
>i : One & Two & Three
>prop2 : 42
>"hello" : "hello"
@@ -25,7 +25,7 @@ const getType = <P extends Params>(params: P) => {
>rest : Omit<P, "foo">
} = params;
>params : P
>params : Params
return rest;
>rest : Omit<P, "foo">
@@ -5,7 +5,7 @@ declare module "events" {
>"events" : typeof import("events")
namespace EventEmitter {
>EventEmitter : typeof EventEmitter
>EventEmitter : typeof import("events")
class EventEmitter {
>EventEmitter : EventEmitter
@@ -0,0 +1,9 @@
tests/cases/compiler/check.js(2,5): error TS1473: An import declaration can only be used at the top level of a module.
==== tests/cases/compiler/check.js (1 errors) ====
function container() {
import "fs";
~~~~~~
!!! error TS1473: An import declaration can only be used at the top level of a module.
}
@@ -0,0 +1,6 @@
=== tests/cases/compiler/check.js ===
function container() {
>container : Symbol(container, Decl(check.js, 0, 0))
import "fs";
}
@@ -0,0 +1,6 @@
=== tests/cases/compiler/check.js ===
function container() {
>container : () => void
import "fs";
}
@@ -0,0 +1,14 @@
tests/cases/conformance/moduleResolution/a/b.ts(1,20): error TS2305: Module '"."' has no exported member 'rootA'.
==== tests/cases/conformance/moduleResolution/a.ts (0 errors) ====
export const rootA = 0;
==== tests/cases/conformance/moduleResolution/a/index.ts (0 errors) ====
export const indexInA = 0;
==== tests/cases/conformance/moduleResolution/a/b.ts (1 errors) ====
import { indexInA, rootA } from ".";
~~~~~
!!! error TS2305: Module '"."' has no exported member 'rootA'.
@@ -0,0 +1,25 @@
//// [tests/cases/conformance/moduleResolution/importFromDot.ts] ////
//// [a.ts]
export const rootA = 0;
//// [index.ts]
export const indexInA = 0;
//// [b.ts]
import { indexInA, rootA } from ".";
//// [a.js]
"use strict";
exports.__esModule = true;
exports.rootA = void 0;
exports.rootA = 0;
//// [index.js]
"use strict";
exports.__esModule = true;
exports.indexInA = void 0;
exports.indexInA = 0;
//// [b.js]
"use strict";
exports.__esModule = true;
@@ -0,0 +1,13 @@
=== tests/cases/conformance/moduleResolution/a.ts ===
export const rootA = 0;
>rootA : Symbol(rootA, Decl(a.ts, 0, 12))
=== tests/cases/conformance/moduleResolution/a/index.ts ===
export const indexInA = 0;
>indexInA : Symbol(indexInA, Decl(index.ts, 0, 12))
=== tests/cases/conformance/moduleResolution/a/b.ts ===
import { indexInA, rootA } from ".";
>indexInA : Symbol(indexInA, Decl(b.ts, 0, 8))
>rootA : Symbol(rootA, Decl(b.ts, 0, 18))
@@ -0,0 +1,15 @@
=== tests/cases/conformance/moduleResolution/a.ts ===
export const rootA = 0;
>rootA : 0
>0 : 0
=== tests/cases/conformance/moduleResolution/a/index.ts ===
export const indexInA = 0;
>indexInA : 0
>0 : 0
=== tests/cases/conformance/moduleResolution/a/b.ts ===
import { indexInA, rootA } from ".";
>indexInA : 0
>rootA : any
@@ -13,7 +13,7 @@ declare module "foo" {
>Point : Point
}
const x: import("foo") = { x: 0, y: 0 };
>x : Point
>x : import("foo")
>{ x: 0, y: 0 } : { x: number; y: number; }
>x : number
>0 : 0
@@ -0,0 +1,26 @@
/a/b/test.ts(3,3): error TS2339: Property 'a' does not exist on type '{ aIndex: number; }'.
/a/test.ts(3,3): error TS2339: Property 'a' does not exist on type '{ aIndex: number; }'.
==== /a.ts (0 errors) ====
export default { a: 0 };
==== /a/index.ts (0 errors) ====
export default { aIndex: 0 };
==== /a/test.ts (1 errors) ====
import a from ".";
import aIndex from "./";
a.a;
~
!!! error TS2339: Property 'a' does not exist on type '{ aIndex: number; }'.
aIndex.aIndex;
==== /a/b/test.ts (1 errors) ====
import a from "..";
import aIndex from "../";
a.a;
~
!!! error TS2339: Property 'a' does not exist on type '{ aIndex: number; }'.
aIndex.aIndex;
@@ -14,9 +14,7 @@ import aIndex from "./";
>aIndex : Symbol(aIndex, Decl(test.ts, 1, 6))
a.a;
>a.a : Symbol(a, Decl(a.ts, 0, 16))
>a : Symbol(a, Decl(test.ts, 0, 6))
>a : Symbol(a, Decl(a.ts, 0, 16))
aIndex.aIndex;
>aIndex.aIndex : Symbol(aIndex, Decl(index.ts, 0, 16))
@@ -31,9 +29,7 @@ import aIndex from "../";
>aIndex : Symbol(aIndex, Decl(test.ts, 1, 6))
a.a;
>a.a : Symbol(a, Decl(a.ts, 0, 16))
>a : Symbol(a, Decl(test.ts, 0, 6))
>a : Symbol(a, Decl(a.ts, 0, 16))
aIndex.aIndex;
>aIndex.aIndex : Symbol(aIndex, Decl(index.ts, 0, 16))
@@ -1,20 +1,22 @@
[
"======== Resolving module '.' from '/a/test.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module as file / folder, candidate module location '/a', target file type 'TypeScript'.",
"File '/a.ts' exist - use it as a name resolution result.",
"======== Module name '.' was successfully resolved to '/a.ts'. ========",
"======== Resolving module './' from '/a/test.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module as file / folder, candidate module location '/a/', target file type 'TypeScript'.",
"File '/a/package.json' does not exist.",
"File '/a/index.ts' exist - use it as a name resolution result.",
"======== Module name '.' was successfully resolved to '/a/index.ts'. ========",
"======== Resolving module './' from '/a/test.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module as file / folder, candidate module location '/a/', target file type 'TypeScript'.",
"File '/a/package.json' does not exist according to earlier cached lookups.",
"File '/a/index.ts' exist - use it as a name resolution result.",
"======== Module name './' was successfully resolved to '/a/index.ts'. ========",
"======== Resolving module '..' from '/a/b/test.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module as file / folder, candidate module location '/a', target file type 'TypeScript'.",
"File '/a.ts' exist - use it as a name resolution result.",
"======== Module name '..' was successfully resolved to '/a.ts'. ========",
"Loading module as file / folder, candidate module location '/a/', target file type 'TypeScript'.",
"File '/a/package.json' does not exist according to earlier cached lookups.",
"File '/a/index.ts' exist - use it as a name resolution result.",
"======== Module name '..' was successfully resolved to '/a/index.ts'. ========",
"======== Resolving module '../' from '/a/b/test.ts'. ========",
"Explicitly specified module resolution kind: 'NodeJs'.",
"Loading module as file / folder, candidate module location '/a/', target file type 'TypeScript'.",
@@ -12,15 +12,15 @@ export default { aIndex: 0 };
=== /a/test.ts ===
import a from ".";
>a : { a: number; }
>a : { aIndex: number; }
import aIndex from "./";
>aIndex : { aIndex: number; }
a.a;
>a.a : number
>a : { a: number; }
>a : number
>a.a : any
>a : { aIndex: number; }
>a : any
aIndex.aIndex;
>aIndex.aIndex : number
@@ -29,15 +29,15 @@ aIndex.aIndex;
=== /a/b/test.ts ===
import a from "..";
>a : { a: number; }
>a : { aIndex: number; }
import aIndex from "../";
>aIndex : { aIndex: number; }
a.a;
>a.a : number
>a : { a: number; }
>a : number
>a.a : any
>a : { aIndex: number; }
>a : any
aIndex.aIndex;
>aIndex.aIndex : number
@@ -23,7 +23,7 @@ declare module "baz" {
}
module c {
>c : typeof c
>c : typeof import("baz")
export var c: string;
>c : string
@@ -0,0 +1,25 @@
tests/cases/compiler/factory.ts(3,1): error TS1269: Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.
==== tests/cases/compiler/jsx.ts (0 errors) ====
export namespace JSXInternal {
export type HTMLAttributes = string
export type ComponentChildren = string
}
==== tests/cases/compiler/factory.ts (1 errors) ====
import { JSXInternal } from "./jsx"
export import JSX = JSXInternal;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1269: Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.
export function createElement<ElementType extends HTMLElement>(
tagName: string,
attributes: JSX.HTMLAttributes,
...children: JSX.ComponentChildren[]
): any {
//...
}
@@ -0,0 +1,33 @@
//// [tests/cases/compiler/isolatedModulesExportImportUninstantiatedNamespace.ts] ////
//// [jsx.ts]
export namespace JSXInternal {
export type HTMLAttributes = string
export type ComponentChildren = string
}
//// [factory.ts]
import { JSXInternal } from "./jsx"
export import JSX = JSXInternal;
export function createElement<ElementType extends HTMLElement>(
tagName: string,
attributes: JSX.HTMLAttributes,
...children: JSX.ComponentChildren[]
): any {
//...
}
//// [jsx.js]
export {};
//// [factory.js]
export function createElement(tagName, attributes) {
var children = [];
for (var _i = 2; _i < arguments.length; _i++) {
children[_i - 2] = arguments[_i];
}
//...
}
@@ -1,14 +1,17 @@
/user.ts(2,10): error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
/user.ts(3,1): error TS1269: Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.
/user.ts(17,10): error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
/user.ts(25,10): error TS1448: 'CC' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled.
==== /user.ts (3 errors) ====
==== /user.ts (4 errors) ====
// Error, can't re-export something that's only a type.
export { T } from "./exportT";
~
!!! error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export import T2 = require("./exportEqualsT");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS1269: Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided.
// OK, has a value side
export { C } from "./exportValue";
@@ -117,7 +117,7 @@
"text": [
{
"text": "T",
"kind": "text"
"kind": "typeParameterName"
}
]
},
@@ -1,5 +1,5 @@
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel.ts(11,8): error TS1235: A namespace declaration is only allowed in a namespace or module.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel.ts(12,8): error TS1235: A namespace declaration is only allowed in a namespace or module.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel.ts(11,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel.ts(12,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
==== tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel.ts (2 errors) ====
@@ -15,9 +15,9 @@ tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel.t
label: module M { }
~~~~~~
!!! error TS1235: A namespace declaration is only allowed in a namespace or module.
!!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
label: namespace N {}
~~~~~~~~~
!!! error TS1235: A namespace declaration is only allowed in a namespace or module.
!!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
label: type T = {}
@@ -1,5 +1,5 @@
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_es2015.ts(11,8): error TS1235: A namespace declaration is only allowed in a namespace or module.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_es2015.ts(12,8): error TS1235: A namespace declaration is only allowed in a namespace or module.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_es2015.ts(11,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_es2015.ts(12,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
==== tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_es2015.ts (2 errors) ====
@@ -15,9 +15,9 @@ tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_e
label: module M { }
~~~~~~
!!! error TS1235: A namespace declaration is only allowed in a namespace or module.
!!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
label: namespace N {}
~~~~~~~~~
!!! error TS1235: A namespace declaration is only allowed in a namespace or module.
!!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
label: type T = {}
@@ -8,9 +8,9 @@ tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_s
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_strict.ts(9,1): error TS1344: 'A label is not allowed here.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_strict.ts(10,1): error TS1344: 'A label is not allowed here.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_strict.ts(12,1): error TS1344: 'A label is not allowed here.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_strict.ts(12,8): error TS1235: A namespace declaration is only allowed in a namespace or module.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_strict.ts(12,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_strict.ts(13,1): error TS1344: 'A label is not allowed here.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_strict.ts(13,8): error TS1235: A namespace declaration is only allowed in a namespace or module.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_strict.ts(13,8): error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_strict.ts(14,1): error TS1344: 'A label is not allowed here.
@@ -48,12 +48,12 @@ tests/cases/conformance/statements/labeledStatements/labeledStatementWithLabel_s
~~~~~
!!! error TS1344: 'A label is not allowed here.
~~~~~~
!!! error TS1235: A namespace declaration is only allowed in a namespace or module.
!!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
label: namespace N {}
~~~~~
!!! error TS1344: 'A label is not allowed here.
~~~~~~~~~
!!! error TS1235: A namespace declaration is only allowed in a namespace or module.
!!! error TS1235: A namespace declaration is only allowed at the top level of a namespace or module.
label: type T = {}
~~~~~
!!! error TS1344: 'A label is not allowed here.
+14
View File
@@ -20,6 +20,11 @@ declare namespace NS {
function computeCommonSourceDirectoryOfFilenames(integer) {
return integer + 1 // pls pls pls
}
/** {@link https://hvad} */
var see3 = true
/** @typedef {number} Attempt {@link https://wat} {@linkcode I think lingcod is better} {@linkplain or lutefisk}*/
//// [linkTagEmit1.js]
@@ -36,6 +41,9 @@ function computeCommonSourceDirectoryOfFilenames(integer) {
function computeCommonSourceDirectoryOfFilenames(integer) {
return integer + 1; // pls pls pls
}
/** {@link https://hvad} */
var see3 = true;
/** @typedef {number} Attempt {@link https://wat} {@linkcode I think lingcod is better} {@linkplain or lutefisk}*/
//// [linkTagEmit1.d.ts]
@@ -50,6 +58,8 @@ function computeCommonSourceDirectoryOfFilenames(integer) {
* @param {number} integer {@link Z}
*/
declare function computeCommonSourceDirectoryOfFilenames(integer: number): number;
/** {@link https://hvad} */
declare var see3: boolean;
type N = number;
type D1 = {
/**
@@ -62,3 +72,7 @@ type D1 = {
m: 1;
};
type Z = number;
/**
* {@link https://wat} {@linkcode I think lingcod is better} {@linkplain or lutefisk}
*/
type Attempt = number;
@@ -26,3 +26,9 @@ function computeCommonSourceDirectoryOfFilenames(integer) {
>integer : Symbol(integer, Decl(linkTagEmit1.js, 12, 49))
}
/** {@link https://hvad} */
var see3 = true
>see3 : Symbol(see3, Decl(linkTagEmit1.js, 17, 3))
/** @typedef {number} Attempt {@link https://wat} {@linkcode I think lingcod is better} {@linkplain or lutefisk}*/
@@ -26,3 +26,10 @@ function computeCommonSourceDirectoryOfFilenames(integer) {
>1 : 1
}
/** {@link https://hvad} */
var see3 = true
>see3 : boolean
>true : true
/** @typedef {number} Attempt {@link https://wat} {@linkcode I think lingcod is better} {@linkplain or lutefisk}*/
@@ -0,0 +1,16 @@
//// [mappedTypeCircularReferenceInAccessor.ts]
interface User {
firstName: string,
level: number,
get bestFriend(): User
set bestFriend(user: SerializablePartial<User>)
}
type FilteredKeys<T> = { [K in keyof T]: T[K] extends number ? K : T[K] extends string ? K : T[K] extends boolean ? K : never }[keyof T];
type SerializablePartial<T> = {
[K in FilteredKeys<T>]: T[K]
};
//// [mappedTypeCircularReferenceInAccessor.js]

Some files were not shown because too many files have changed in this diff Show More