Skip to content

[F] createSuppressCodeFix

function createSuppressCodeFix(
diagnosticTarget,
warningCode,
suppressionMessage?
): CodeFix;

Create a fix that inserts a #suppress directive before the nearest supported suppression target. Requires a bound, non-synthetic target or an explicit location in a real source file. Check getSourceLocation before offering the fix and skip targets whose location is synthetic.

ParameterTypeDefault value
diagnosticTargetDiagnosticTargetundefined
warningCodestringundefined
suppressionMessagestring""

CodeFix