Skip to content

Commit d3d7981

Browse files
authored
fix: fallback to default options if options is not passed (#1225)
1 parent c032eeb commit d3d7981

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/options.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ import { z } from 'zod';
22

33
export type Options = z.infer<typeof ruleOptionsSchema>;
44

5-
export const ruleOptionsSchema = z.object({
6-
allow: z
7-
.object({
8-
features: z.array(z.string()).default(() => []),
9-
flagged: z.boolean().default(false),
10-
partialImplementation: z.boolean().default(false),
11-
prefix: z.boolean().default(true),
12-
})
13-
.prefault({}),
14-
browserslist: z.union([z.string(), z.array(z.string())]).optional(),
15-
});
5+
export const ruleOptionsSchema = z
6+
.object({
7+
allow: z
8+
.object({
9+
features: z.array(z.string()).default(() => []),
10+
flagged: z.boolean().default(false),
11+
partialImplementation: z.boolean().default(false),
12+
prefix: z.boolean().default(true),
13+
})
14+
.prefault({}),
15+
browserslist: z.union([z.string(), z.array(z.string())]).optional(),
16+
})
17+
.prefault({});

0 commit comments

Comments
 (0)