Skip to content

Commit ef5f7bc

Browse files
committed
Fix lint
1 parent 351f665 commit ef5f7bc

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

src/compiler/checker.ts

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4298,7 +4298,7 @@ namespace ts {
42984298
type = getContextualThisParameterType(func);
42994299
}
43004300
else {
4301-
type = getContextuallyTypedParameterType(<ParameterDeclaration>declaration)
4301+
type = getContextuallyTypedParameterType(<ParameterDeclaration>declaration);
43024302
}
43034303
if (type) {
43044304
return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality);
@@ -4329,8 +4329,8 @@ namespace ts {
43294329

43304330
// Important to do this *after* attempt has been made to resolve via initializer
43314331
if (declaration.kind === SyntaxKind.Parameter) {
4332-
const inferredType = getParameterTypeFromBody(<ParameterDeclaration>declaration)
4333-
if (inferredType) return inferredType
4332+
const inferredType = getParameterTypeFromBody(<ParameterDeclaration>declaration);
4333+
if (inferredType) return inferredType;
43344334
}
43354335

43364336
// No type specified and nothing can be inferred
@@ -12805,11 +12805,11 @@ namespace ts {
1280512805
}
1280612806

1280712807
function getParameterTypeFromBody(parameter: ParameterDeclaration): Type {
12808-
const func = <FunctionLikeDeclaration>parameter.parent
12809-
if (!func.body || isRestParameter(parameter)) return
12808+
const func = <FunctionLikeDeclaration>parameter.parent;
12809+
if (!func.body || isRestParameter(parameter)) return;
1281012810

12811-
const types = checkAndAggregateParameterExpressionTypes(parameter)
12812-
return types ? getWidenedType(getIntersectionType(types)) : undefined
12811+
const types = checkAndAggregateParameterExpressionTypes(parameter);
12812+
return types ? getWidenedType(getIntersectionType(types)) : undefined;
1281312813
}
1281412814

1281512815
// Return contextual type of parameter or undefined if no contextual type is available
@@ -16744,20 +16744,18 @@ namespace ts {
1674416744
}
1674516745

1674616746
function checkAndAggregateParameterExpressionTypes(parameter: ParameterDeclaration): Type[] {
16747-
const func = <FunctionLikeDeclaration>parameter.parent
16748-
const usageTypes: Type[] = []
16747+
const func = <FunctionLikeDeclaration>parameter.parent;
16748+
const usageTypes: Type[] = [];
1674916749
forEachInvocation(<Block>func.body, invocation => {
1675016750
const usages = invocation.arguments
1675116751
.map((arg, i) => ({ arg, symbol: getSymbolAtLocation(arg), i }))
16752-
.filter(({ symbol }) => symbol && symbol.valueDeclaration === parameter)
16753-
if (!usages.length)
16754-
return
16755-
const funcSymbol = getSymbolAtLocation(invocation.expression)
16756-
if (!funcSymbol || !isFunctionLike(funcSymbol.valueDeclaration))
16757-
return
16758-
const sig = getSignatureFromDeclaration(funcSymbol.valueDeclaration)
16759-
const parameterTypes = sig.parameters.map(getTypeOfParameter)
16760-
const argumentTypes = usages.map(({ i }) => parameterTypes[i]).filter(t => !!t)
16752+
.filter(({ symbol }) => symbol && symbol.valueDeclaration === parameter);
16753+
if (!usages.length) return;
16754+
const funcSymbol = getSymbolAtLocation(invocation.expression);
16755+
if (!funcSymbol || !isFunctionLike(funcSymbol.valueDeclaration)) return;
16756+
const sig = getSignatureFromDeclaration(funcSymbol.valueDeclaration);
16757+
const parameterTypes = sig.parameters.map(getTypeOfParameter);
16758+
const argumentTypes = usages.map(({ i }) => parameterTypes[i]).filter(t => !!t);
1676116759
usageTypes.splice(0, 0, ...argumentTypes);
1676216760
});
1676316761
return usageTypes.length ? usageTypes : undefined;

src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ namespace ts {
764764
function traverse(node: Node): T {
765765
switch (node.kind) {
766766
case SyntaxKind.CallExpression:
767-
return visitor(<CallExpression>node)
767+
return visitor(<CallExpression>node);
768768
default:
769769
return forEachChild(node, traverse);
770770
}

0 commit comments

Comments
 (0)