[html] A 'return' statement can only be used within a function body. Fixes #143220

This commit is contained in:
Martin Aeschlimann
2022-04-04 18:19:24 +02:00
parent c7a685113b
commit a0612b2e04
2 changed files with 3 additions and 1 deletions

View File

@@ -87,7 +87,7 @@ export function getJavaScriptMode(documentRegions: LanguageModelCache<HTMLDocume
const languageService = await host.getLanguageService(jsDocument);
const syntaxDiagnostics: ts.Diagnostic[] = languageService.getSyntacticDiagnostics(jsDocument.uri);
const semanticDiagnostics = languageService.getSemanticDiagnostics(jsDocument.uri);
return syntaxDiagnostics.concat(semanticDiagnostics).map((diag: ts.Diagnostic): Diagnostic => {
return syntaxDiagnostics.concat(semanticDiagnostics).filter(d => d.code !== 1108).map((diag: ts.Diagnostic): Diagnostic => {
return {
range: convertRange(jsDocument, diag),
severity: DiagnosticSeverity.Error,