Skip to content

WarnerOptions

ts
interface WarnerOptions {
  level?: WarningLevel;
  maxWarnings?: number;
  onWarn?: (warning: Warning) => unknown;
  onSummary?: (count: number, warnings: Warning[]) => unknown;
  packageName?: string;
  protectionLevel?: ProtectionLevel;
}

Represents the configuration options for creating a Warner instance. It allows you to specify the warning level, maximum number of warnings, custom handlers for warnings and summaries, package name for metadata, and the protection level for validation strictness.

Fields

FieldTypeDescription
levelWarningLevelOutput mode for warnings.
maxWarningsnumberOptional cap for tracked warnings.
onWarn(warning: Warning) => unknownCallback called per warning.
onSummary(count: number, warnings: Warning[]) => unknownCallback called on finalize/flush summary.
packageNamestringLabel used in warning metadata.
protectionLevelProtectionLevelValidation strictness.

References