Skip to content

CheckProjectTypesParams.shouldKeepDiagnostic method

CheckProjectTypesParams › shouldKeepDiagnostic

Decides whether a diagnostic should be reported, based on the diagnostic itself rather than its source file. Runs in addition to CheckProjectTypesParams.shouldKeepFile — a diagnostic is reported only when both predicates keep it. Use this to drop diagnostics that are reported in a file we own but are caused by something we do not control (e.g. a cross-module-format interop complaint about a third-party import). When omitted, no diagnostic is dropped on this basis.

Signature:

shouldKeepDiagnostic(this: void, diagnostic: Diagnostic): boolean

Parameters:

ParameterTypeDescription
thisvoid
diagnosticDiagnosticThe diagnostic to evaluate.

Returns: booleantrue to report the diagnostic, false to ignore it.