-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathconfig.ts
More file actions
37 lines (33 loc) · 1.1 KB
/
config.ts
File metadata and controls
37 lines (33 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { z } from 'zod';
import {
filePathSchema,
pluginScoreTargetsSchema,
positiveIntSchema,
} from '@code-pushup/models';
import { AXE_DEFAULT_PRESET, DEFAULT_TIMEOUT_MS } from './constants.js';
export const axePresets = [
'wcag21aa',
'wcag22aa',
'best-practice',
'all',
] as const;
export const axePresetSchema = z.enum(axePresets).meta({ title: 'AxePreset' });
export type AxePreset = z.infer<typeof axePresetSchema>;
export const axePluginOptionsSchema = z
.object({
preset: axePresetSchema.default(AXE_DEFAULT_PRESET).meta({
description:
'Accessibility ruleset preset (default: wcag21aa for WCAG 2.1 Level AA compliance)',
}),
setupScript: filePathSchema.optional(),
scoreTargets: pluginScoreTargetsSchema.optional(),
timeout: positiveIntSchema.default(DEFAULT_TIMEOUT_MS).meta({
description:
'Page navigation timeout in milliseconds (default: 30000ms / 30s)',
}),
})
.meta({
title: 'AxePluginOptions',
description: 'Configuration options for the Axe plugin',
});
export type AxePluginOptions = z.input<typeof axePluginOptionsSchema>;