diff --git a/server/src/services/typescriptService/serviceHost.ts b/server/src/services/typescriptService/serviceHost.ts index a1c3873a2c..1b76a68527 100644 --- a/server/src/services/typescriptService/serviceHost.ts +++ b/server/src/services/typescriptService/serviceHost.ts @@ -400,7 +400,6 @@ export function getServiceHost( const jsHost = createLanguageServiceHost(compilerOptions); const templateHost = createLanguageServiceHost({ ...compilerOptions, - noImplicitAny: false, noUnusedLocals: false, noUnusedParameters: false, allowJs: true, diff --git a/server/src/services/typescriptService/templateDiagnosticFilter.ts b/server/src/services/typescriptService/templateDiagnosticFilter.ts index b6c63e4284..414a7003a8 100644 --- a/server/src/services/typescriptService/templateDiagnosticFilter.ts +++ b/server/src/services/typescriptService/templateDiagnosticFilter.ts @@ -48,7 +48,27 @@ export function createTemplateDiagnosticFilter(tsModule: T_TypeScript) { return true; }; - return mergeFilter([ignorePrivateProtectedViolation]); + const ignoreNoImplicitAnyViolationInNativeEvent: DiagnosticFilter = diag => { + const noImplicitAnyViolation = 7006; + + if (diag.code !== noImplicitAnyViolation) { + return true; + } + + const source = diag.file; + if (!source) { + return true; + } + + const target = findNodeFromDiagnostic(diag, source); + if (target && tsModule.isParameter(target.parent)) { + return false; + } + + return true; + }; + + return mergeFilter([ignorePrivateProtectedViolation, ignoreNoImplicitAnyViolationInNativeEvent]); } /** diff --git a/test/interpolation/features/diagnostics/basic.test.ts b/test/interpolation/features/diagnostics/basic.test.ts index b5fa7fe863..3907ce0596 100644 --- a/test/interpolation/features/diagnostics/basic.test.ts +++ b/test/interpolation/features/diagnostics/basic.test.ts @@ -254,7 +254,14 @@ describe('Should find template-diagnostics in