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
| Field | Type | Description |
|---|---|---|
level | WarningLevel | Output mode for warnings. |
maxWarnings | number | Optional cap for tracked warnings. |
onWarn | (warning: Warning) => unknown | Callback called per warning. |
onSummary | (count: number, warnings: Warning[]) => unknown | Callback called on finalize/flush summary. |
packageName | string | Label used in warning metadata. |
protectionLevel | ProtectionLevel | Validation strictness. |