From 78b8275ab6407c07dbba8a838fea9a64e5fcbd3b Mon Sep 17 00:00:00 2001 From: Kanchalai Tanglertsampan Date: Tue, 4 Apr 2017 15:43:56 -0700 Subject: [PATCH] Fix linting error --- src/compiler/checker.ts | 10 +++------- src/compiler/transformers/module/module.ts | 2 +- src/compiler/transformers/module/system.ts | 2 +- src/compiler/types.ts | 2 +- src/compiler/utilities.ts | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 1205ce278a8..1089e9d2c7d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1,4 +1,4 @@ -/// +/// /// /* @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) { diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index 8ffea8f395c..f9de12f4958 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -558,7 +558,7 @@ namespace ts { createCall(createIdentifier("require"), /*typeArguments*/ undefined, [createArrayLiteral(node.arguments), resolve])) ]); } - + function transformImportCallExpressionCommonJS(node: ImportCall): Expression { // import("./blah") // emit as diff --git a/src/compiler/transformers/module/system.ts b/src/compiler/transformers/module/system.ts index f5505016b9f..1e3b2dd4350 100644 --- a/src/compiler/transformers/module/system.ts +++ b/src/compiler/transformers/module/system.ts @@ -1488,7 +1488,7 @@ namespace ts { // } // }; // }); - return createCall( + return createCall( createPropertyAccess( contextObject, createIdentifier("import") diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 2f94510519b..0b51f7e2173 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1052,7 +1052,7 @@ namespace ts { } export interface ImportExpression extends PrimaryExpression { - kind: SyntaxKind.ImportKeyword + kind: SyntaxKind.ImportKeyword; } export interface DeleteExpression extends UnaryExpression { diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 40ff1a063f2..f4a1e0216b9 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -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 {