diff --git a/linter-4.2/src/TypeScriptLinter.ts b/linter-4.2/src/TypeScriptLinter.ts index cbe8b31066ef0bf90cc024eff31ca6ac31338299..2404105184ad378606ed8aee82fb06b1ce20c908 100644 --- a/linter-4.2/src/TypeScriptLinter.ts +++ b/linter-4.2/src/TypeScriptLinter.ts @@ -1719,12 +1719,15 @@ export class TypeScriptLinter { private handleCallExpression(node: ts.Node) { let tsCallExpr = node as ts.CallExpression; + const exprSym = this.tsUtils.trueSymbolAtLocation(tsCallExpr.expression); this.handleImportCall(tsCallExpr); this.handleRequireCall(tsCallExpr); // NOTE: Keep handleFunctionApplyBindPropCall above handleGenericCallWithNoTypeArgs here!!! - this.handleFunctionApplyBindPropCall(tsCallExpr); - this.handleGenericCallWithNoTypeArgs(tsCallExpr); + this.handleFunctionApplyBindPropCall(tsCallExpr, exprSym); + if (!this.tsUtils.isLibrarySymbol(exprSym)) { + this.handleGenericCallWithNoTypeArgs(tsCallExpr); + } this.handleStructIdentAndUndefinedInArgs(tsCallExpr); this.handleStdlibAPICall(tsCallExpr); this.handleLibraryTypeCall(tsCallExpr); @@ -1801,7 +1804,7 @@ export class TypeScriptLinter { } } - private handleFunctionApplyBindPropCall(tsCallExpr: ts.CallExpression) { + private handleFunctionApplyBindPropCall(tsCallExpr: ts.CallExpression, exprSymbol: ts.Symbol | undefined) { const stdFunction = "Function"; const callableFunction = "CallableFunction"; const funcProps = [ @@ -1813,9 +1816,6 @@ export class TypeScriptLinter { `${callableFunction}.bind`, ]; - const exprSymbol = this.tsUtils.trueSymbolAtLocation( - tsCallExpr.expression - ); if (exprSymbol === undefined) { return; } diff --git a/linter/src/TypeScriptLinter.ts b/linter/src/TypeScriptLinter.ts index aaa107e74a5e65ad51dc5bc7a333974e13938de6..01f8548ea34aa14f7d21fe21332a7bdb37bb6037 100644 --- a/linter/src/TypeScriptLinter.ts +++ b/linter/src/TypeScriptLinter.ts @@ -1410,11 +1410,15 @@ export class TypeScriptLinter { private handleCallExpression(node: ts.Node) { let tsCallExpr = node as ts.CallExpression; + const exprSym = this.tsUtils.trueSymbolAtLocation(tsCallExpr.expression); + this.handleImportCall(tsCallExpr); this.handleRequireCall(tsCallExpr); // NOTE: Keep handleFunctionApplyBindPropCall above handleGenericCallWithNoTypeArgs here!!! - this.handleFunctionApplyBindPropCall(tsCallExpr); - this.handleGenericCallWithNoTypeArgs(tsCallExpr); + this.handleFunctionApplyBindPropCall(tsCallExpr, exprSym); + if (!this.tsUtils.isLibrarySymbol(exprSym)) { + this.handleGenericCallWithNoTypeArgs(tsCallExpr); + } this.handleStructIdentAndUndefinedInArgs(tsCallExpr); this.handleStdlibAPICall(tsCallExpr); this.handleLibraryTypeCall(tsCallExpr); @@ -1477,7 +1481,7 @@ export class TypeScriptLinter { } } - private handleFunctionApplyBindPropCall(tsCallExpr: ts.CallExpression) { + private handleFunctionApplyBindPropCall(tsCallExpr: ts.CallExpression, exprSymbol: ts.Symbol | undefined) { const stdFunction = 'Function'; const callableFunction = 'CallableFunction'; const funcProps = [ @@ -1488,7 +1492,6 @@ export class TypeScriptLinter { `${callableFunction}.call`, `${callableFunction}.bind`, ]; - const exprSymbol = this.tsUtils.trueSymbolAtLocation(tsCallExpr.expression); if (exprSymbol === undefined) { return; }