-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathaudit.ts
More file actions
24 lines (22 loc) · 839 Bytes
/
Copy pathaudit.ts
File metadata and controls
24 lines (22 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { z } from 'zod';
import { createDuplicateSlugsCheck } from './implementation/checks.js';
import { metaSchema, slugSchema } from './implementation/schemas.js';
export const auditSchema = z
.object({
slug: slugSchema.describe('ID (unique within plugin)'),
})
.extend(
metaSchema({
titleDescription: 'Descriptive name',
descriptionDescription: 'Description (markdown)',
docsUrlDescription: 'Link to documentation (rationale)',
description: 'List of scorable metrics for the given plugin',
isSkippedDescription: 'Indicates whether the audit is skipped',
}).shape,
);
export type Audit = z.infer<typeof auditSchema>;
export const pluginAuditsSchema = z
.array(auditSchema)
.min(1)
.check(createDuplicateSlugsCheck('Audit'))
.describe('List of audits maintained in a plugin');