diff --git a/extensions/html-language-features/server/src/modes/javascriptMode.ts b/extensions/html-language-features/server/src/modes/javascriptMode.ts
index 10a70dbe99a..0c199571dd7 100644
--- a/extensions/html-language-features/server/src/modes/javascriptMode.ts
+++ b/extensions/html-language-features/server/src/modes/javascriptMode.ts
@@ -93,13 +93,16 @@ function getLanguageServiceHost(scriptKind: ts.ScriptKind) {
};
}
+const ignoredErrors = [
+ 1108, /* A_return_statement_can_only_be_used_within_a_function_body_1108 */
+ 2792, /* Cannot_find_module_0_Did_you_mean_to_set_the_moduleResolution_option_to_node_or_to_add_aliases_to_the_paths_option */
+];
export function getJavaScriptMode(documentRegions: LanguageModelCache, languageId: 'javascript' | 'typescript', workspace: Workspace): LanguageMode {
const jsDocuments = getLanguageModelCache(10, 60, document => documentRegions.get(document).getEmbeddedDocument(languageId));
const host = getLanguageServiceHost(languageId === 'javascript' ? ts.ScriptKind.JS : ts.ScriptKind.TS);
const globalSettings: Settings = {};
-
return {
getId() {
return languageId;
@@ -110,7 +113,7 @@ export function getJavaScriptMode(documentRegions: LanguageModelCache d.code !== 1108).map((diag: ts.Diagnostic): Diagnostic => {
+ return syntaxDiagnostics.concat(semanticDiagnostics).filter(d => !ignoredErrors.includes(d.code)).map((diag: ts.Diagnostic): Diagnostic => {
return {
range: convertRange(jsDocument, diag),
severity: DiagnosticSeverity.Error,