@webjsdev/ui 0.3.14 → 0.3.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -82,6 +82,43 @@ export const registryItemCommonSchema = z.object({
82
82
  categories: z.array(z.string()).optional(),
83
83
  });
84
84
 
85
+ /** A rule's severity. Absent from `lint.rules` means `off`. */
86
+ export const lintSeveritySchema = z.enum(['off', 'warn', 'error']);
87
+
88
+ /**
89
+ * One rule's configuration: a bare severity, or an object adding `allow`
90
+ * (category names such as `layout` / `spacing`, or class-group names such
91
+ * as `rounded`). Kept `.strict()` so a typo is a config error, not a silent
92
+ * no-op.
93
+ */
94
+ export const lintRuleSchema = z.union([
95
+ lintSeveritySchema,
96
+ z
97
+ .object({
98
+ severity: lintSeveritySchema.default('warn'),
99
+ allow: z.array(z.string()).optional(),
100
+ })
101
+ .strict(),
102
+ ]);
103
+
104
+ /**
105
+ * The opt-in `lint` block of `components.json`, read by `webjsui lint`. No
106
+ * block means every rule is off and the command reports nothing.
107
+ */
108
+ export const lintConfigSchema = z
109
+ .object({
110
+ ignore: z.array(z.string()).default([]),
111
+ rules: z
112
+ .object({
113
+ 'no-raw-colors': lintRuleSchema.optional(),
114
+ 'no-arbitrary-values': lintRuleSchema.optional(),
115
+ 'no-restyle': lintRuleSchema.optional(),
116
+ })
117
+ .strict()
118
+ .default({}),
119
+ })
120
+ .strict();
121
+
85
122
  export const rawConfigSchema = z
86
123
  .object({
87
124
  $schema: z.string().optional(),
@@ -94,6 +131,7 @@ export const rawConfigSchema = z
94
131
  prefix: z.string().default('').optional(),
95
132
  }),
96
133
  iconLibrary: z.string().optional().default('lucide'),
134
+ lint: lintConfigSchema.optional(),
97
135
  aliases: z.object({
98
136
  components: z.string().default('components'),
99
137
  utils: z.string().default('lib/utils'),