diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index db2a3c0e066..f54e363487c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16332,11 +16332,11 @@ namespace ts { return emptyObjectType; } - function createPromiseReturnType(func: FunctionLikeDeclaration | CallExpression, promisedType: Type) { + function createPromiseReturnType(func: FunctionLikeDeclaration | ImportCall, promisedType: Type) { const promiseType = createPromiseType(promisedType); if (promiseType === emptyObjectType) { 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.A_dynamic_import_call_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; } @@ -17705,7 +17705,7 @@ namespace ts { if ((node).expression.kind === SyntaxKind.ImportKeyword) { return checkImportCallExpression(node); } - /* tslint:disable: no-switch-case-fall-through */ + /* falls through */ case SyntaxKind.NewExpression: return checkCallExpression(node); case SyntaxKind.TaggedTemplateExpression: diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 70a3465a6ee..4a6c2153567 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2172,7 +2172,7 @@ "category": "Error", "code": 2710 }, - "A dynamic import call must return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option.": { + "A dynamic import call return a 'Promise'. Make sure you have a declaration for 'Promise' or include 'ES2015' in your `--lib` option.": { "category": "Error", "code": 2711 }, diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 58270627d49..2e4de9bdd24 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -3700,7 +3700,7 @@ namespace ts { // For example: // var foo3 = require("subfolder // import * as foo1 from "module-from-node -> we want this import to be a statement rather than import call expression - sourceFile.flags |= NodeFlags.possiblyContainDynamicImport; + sourceFile.flags |= NodeFlags.PossiblyContainDynamicImport; expression = parseTokenNode(); } else { diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 61a1e0ba246..c37d07db81a 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -1383,7 +1383,7 @@ namespace ts { for (const node of file.statements) { collectModuleReferences(node, /*inAmbientModule*/ false); - if ((file.flags & NodeFlags.possiblyContainDynamicImport) || isJavaScriptFile) { + if ((file.flags & NodeFlags.PossiblyContainDynamicImport) || isJavaScriptFile) { collectDynamicImportOrRequireCalls(node); } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index b2d4878a415..756ef4adbac 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -456,7 +456,7 @@ namespace ts { // During editing, if dynamic import is remove, incremental parsing will *NOT* update this flag. This will then causes walking of the tree during module resolution. // However, the removal operation should not occur often and in the case of the removal, it is likely that users will add back the import anyway. // The advantage of this approach is its simplicity. For the case of batch compilation, we garuntee that users won't have to pay the price of walking the tree if dynamic import isn't used. - possiblyContainDynamicImport = 1 << 19, + PossiblyContainDynamicImport = 1 << 19, BlockScoped = Let | Const,