Configuration Reference
This page documents all available options for the peek.config.js configuration file.
Config File Format
Create peek.config.js (or peek.config.mjs) in your project root and export a default object:
export default {
ignore: [],
checks: {},
severity: {},
};Pass it to peek check with -c:
peek check http://localhost:3000 -c peek.config.jsTop-Level Options
ignore
Type: string[] Default: []
CSS selectors for elements to exclude from all checks. Merged with --ignore CLI flags and per-check ignore arrays.
ignore: [
'.ad-banner',
'[data-testid="skeleton"]',
'.cookie-popup',
]checks
Type: ChecksConfig Default: All checks enabled with defaults
Per-check configuration. Each key corresponds to a check name. Set to true (default), false (disabled), or an object with options.
checks: {
overflow: { horizontal: true, vertical: false },
clickability: { checkCorners: true },
touchTargets: { minWidth: 44, minHeight: 44 },
textOverflow: { allowEllipsis: true },
visibility: true,
viewportMeta: true,
}severity
Type: Partial<Record<CheckName, Severity>> Default: Check-specific defaults
Override the default severity for specific checks. Valid severity values: 'error', 'warning', 'info'.
severity: {
touchTargets: 'warning',
textOverflow: 'info',
overflow: 'error',
}Check-Specific Options
checks.overflow
Type: boolean | OverflowConfig
Detect horizontal overflow causing unwanted scrollbars.
| Option | Type | Default | Description |
|---|---|---|---|
horizontal | boolean | true | Check for horizontal overflow |
vertical | boolean | false | Check for vertical overflow |
ignore | string[] | [] | Additional selectors to skip |
checks: {
overflow: {
horizontal: true,
vertical: false,
ignore: ['.horizontal-scroll-container'],
}
}checks.clickability
Type: boolean | ClickabilityConfig
Detect interactive elements covered by other elements.
| Option | Type | Default | Description |
|---|---|---|---|
selectors | string[] | ['button', 'a', 'input', ...] | Elements to check |
checkCorners | boolean | true | Check corner points in addition to center |
ignore | string[] | [] | Additional selectors to skip |
Default selectors: button, a, input, select, textarea, [role="button"], [role="link"], [onclick], [tabindex="0"].
checks: {
clickability: {
selectors: ['button', 'a', '[role="button"]'],
checkCorners: true,
}
}checks.touchTargets
Type: boolean | TouchTargetsConfig
Ensure interactive elements meet minimum touch target size and spacing.
| Option | Type | Default | Description |
|---|---|---|---|
minWidth | number | 44 | Minimum width in pixels (WCAG 2.5.5) |
minHeight | number | 44 | Minimum height in pixels |
selectors | string[] | ['button', 'a', 'input', ...] | Elements to check |
ignore | string[] | [] | Additional selectors to skip |
Default selectors: button, a, input:not([type="hidden"]), select, textarea, [role="button"], [role="link"], [role="checkbox"], [role="radio"], [tabindex="0"].
Spacing check: 8px minimum gap between adjacent interactive elements.
checks: {
touchTargets: {
minWidth: 48,
minHeight: 48,
ignore: ['.desktop-nav a'],
}
}checks.textOverflow
Type: boolean | TextOverflowConfig
Detect text clipped or overflowing its container.
| Option | Type | Default | Description |
|---|---|---|---|
allowEllipsis | boolean | true | Skip elements using text-overflow: ellipsis |
ignore | string[] | [] | Additional selectors to skip |
Elements with .truncate, [data-truncate], or .line-clamp classes are always skipped.
checks: {
textOverflow: {
allowEllipsis: true,
ignore: ['.code-block', 'pre'],
}
}checks.visibility
Type: boolean | VisibilityConfig
Detect interactive elements that are invisible or off-screen.
| Option | Type | Default | Description |
|---|---|---|---|
selectors | string[] | ['button', 'a[href]', 'input', ...] | Elements to check |
ignore | string[] | [] | Additional selectors to skip |
Default selectors: button, a[href], input:not([type="hidden"]), select, textarea, [role="button"].
Elements with aria-hidden="true", .sr-only, .visually-hidden, or [hidden] are always skipped.
checks: {
visibility: {
selectors: ['button', 'a[href]', 'input'],
ignore: ['.off-canvas-menu'],
}
}checks.viewportMeta
Type: boolean | ViewportMetaConfig
Check for a proper viewport meta tag for mobile rendering.
| Option | Type | Default | Description |
|---|---|---|---|
ignore | string[] | [] | (Not applicable for this check) |
checks: {
viewportMeta: true
}Complete Example
export default {
ignore: [
'.ad-banner',
'[data-testid="skeleton"]',
'.cookie-consent',
],
checks: {
overflow: { horizontal: true, vertical: false },
clickability: { checkCorners: true },
touchTargets: { minWidth: 44, minHeight: 44 },
textOverflow: { allowEllipsis: true },
visibility: true,
viewportMeta: true,
},
severity: {
touchTargets: 'warning',
textOverflow: 'warning',
visibility: 'warning',
},
};TypeScript Types
If using the programmatic API, import types for config objects:
import type {
CheckConfig,
ChecksConfig,
OverflowConfig,
ClickabilityConfig,
TouchTargetsConfig,
TextOverflowConfig,
VisibilityConfig,
ViewportMetaConfig,
Severity,
} from 'peek';