mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fix linting error
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/// <reference path="moduleNameResolver.ts"/>
|
||||
/// <reference path="moduleNameResolver.ts"/>
|
||||
/// <reference path="binder.ts"/>
|
||||
|
||||
/* @internal */
|
||||
@@ -15809,7 +15809,7 @@ namespace ts {
|
||||
function createPromiseReturnType(func: FunctionLikeDeclaration | CallExpression, promisedType: Type) {
|
||||
const promiseType = createPromiseType(promisedType);
|
||||
if (promiseType === emptyObjectType) {
|
||||
error(func, isImportCall(func) ?
|
||||
error(func, isImportCall(func) ?
|
||||
Diagnostics.A_dynamic_import_call_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option :
|
||||
Diagnostics.An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option);
|
||||
return unknownType;
|
||||
@@ -15817,7 +15817,7 @@ namespace ts {
|
||||
else if (!getGlobalPromiseConstructorSymbol(/*reportErrors*/ true)) {
|
||||
error(func, isImportCall(func) ?
|
||||
Diagnostics.A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option :
|
||||
Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
|
||||
Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
|
||||
}
|
||||
|
||||
return promiseType;
|
||||
@@ -24066,10 +24066,6 @@ namespace ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param node
|
||||
*/
|
||||
function checkGrammarImportCallExpression(node: ImportCall): boolean {
|
||||
const arguments = node.arguments;
|
||||
if (arguments.length !== 1) {
|
||||
|
||||
@@ -558,7 +558,7 @@ namespace ts {
|
||||
createCall(createIdentifier("require"), /*typeArguments*/ undefined, [createArrayLiteral(node.arguments), resolve]))
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
function transformImportCallExpressionCommonJS(node: ImportCall): Expression {
|
||||
// import("./blah")
|
||||
// emit as
|
||||
|
||||
@@ -1488,7 +1488,7 @@ namespace ts {
|
||||
// }
|
||||
// };
|
||||
// });
|
||||
return createCall(
|
||||
return createCall(
|
||||
createPropertyAccess(
|
||||
contextObject,
|
||||
createIdentifier("import")
|
||||
|
||||
@@ -1052,7 +1052,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
export interface ImportExpression extends PrimaryExpression {
|
||||
kind: SyntaxKind.ImportKeyword
|
||||
kind: SyntaxKind.ImportKeyword;
|
||||
}
|
||||
|
||||
export interface DeleteExpression extends UnaryExpression {
|
||||
|
||||
@@ -3906,7 +3906,7 @@ namespace ts {
|
||||
|| kind === SyntaxKind.TrueKeyword
|
||||
|| kind === SyntaxKind.SuperKeyword
|
||||
|| kind === SyntaxKind.NonNullExpression
|
||||
|| kind === SyntaxKind.MetaProperty
|
||||
|| kind === SyntaxKind.MetaProperty;
|
||||
}
|
||||
|
||||
export function isLeftHandSideExpression(node: Node): node is LeftHandSideExpression {
|
||||
|
||||
Reference in New Issue
Block a user