@salasebas/shadcn-lint-extra 0.0.0-stage → 0.1.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 salasebas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,47 @@
1
- # Temporary Holding Version
1
+ # @salasebas/shadcn-lint-extra
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Extra lint rules for [shadcn/ui](https://ui.shadcn.com) projects, to run next to [`@shadcn/lint`](https://github.com/shadcn-ui/lint). Runs on ESLint and Oxlint, and reads React, Svelte, and Vue templates.
4
+
5
+ `@shadcn/lint` checks the classes you pass to a component. This plugin checks how you compose components: which group an item belongs in, how long a label is, and how often a variant repeats in one file.
6
+
7
+ This is a community plugin. It is not part of shadcn/ui.
8
+
9
+ | Rule | What it checks |
10
+ | ---------------------------------------------------- | ---------------------------------------------------------- |
11
+ | [items-in-group](./docs/rules/items-in-group.md) | `Select` and `Command` items outside their group. |
12
+ | [component-limits](./docs/rules/component-limits.md) | Text length per component, and uses of a variant per file. |
13
+
14
+ ## Get started
15
+
16
+ ```bash
17
+ pnpm add -D @salasebas/shadcn-lint-extra
18
+ ```
19
+
20
+ Set it up the same way as [`@shadcn/lint`](https://github.com/shadcn-ui/lint#get-started), with the same parsers, and add both plugins to the same block. In Oxlint, add `@salasebas/shadcn-lint-extra` to `jsPlugins`. Rule IDs read `shadcn-extra/<rule>` in both linters.
21
+
22
+ ```js
23
+ import { plugin as shadcn } from "@shadcn/lint";
24
+ import { plugin as shadcnExtra } from "@salasebas/shadcn-lint-extra";
25
+
26
+ export default [
27
+ {
28
+ plugins: { shadcn, "shadcn-extra": shadcnExtra },
29
+ rules: {
30
+ "shadcn/no-restyle": ["error", { allow: ["layout"] }],
31
+ "shadcn-extra/items-in-group": "error",
32
+ "shadcn-extra/component-limits": [
33
+ "error",
34
+ { Button: { maxTextLength: 24, maxPerVariant: { default: 1 } } },
35
+ ],
36
+ },
37
+ },
38
+ ];
39
+ ```
40
+
41
+ This plugin has no rule for padding on a component. `shadcn/no-restyle` already reports it and suggests a size instead.
42
+
43
+ Oxlint reads only the `<script>` block of `.svelte` and `.vue` files, so lint Svelte and Vue templates with ESLint. `@shadcn/lint` has the same limit.
44
+
45
+ ## License
46
+
47
+ [MIT](./LICENSE)
@@ -0,0 +1,38 @@
1
+ import "eslint";
2
+ type ComponentLimit = {
3
+ readonly maxTextLength?: number;
4
+ readonly maxPerVariant?: Readonly<Record<string, number>>;
5
+ };
6
+ /** Limits keyed by the component name as the tag writes it, such as `Button` or `CardTitle`. */
7
+ type ComponentLimits = Readonly<Record<string, ComponentLimit>>;
8
+ type ItemsInGroupOptions = {
9
+ /** Regexes for the import paths of the project's shadcn components. */
10
+ readonly componentImports?: readonly string[];
11
+ };
12
+ export declare const rules: {
13
+ "component-limits": {
14
+ meta: import("eslint").Rule.RuleMetaData;
15
+ create(context: import("eslint").Rule.RuleContext): import("eslint").Rule.RuleListener;
16
+ };
17
+ "items-in-group": {
18
+ meta: import("eslint").Rule.RuleMetaData;
19
+ create(context: import("eslint").Rule.RuleContext): import("eslint").Rule.RuleListener;
20
+ };
21
+ };
22
+ /** `meta.name` is the rule namespace in Oxlint, so rule IDs read `shadcn-extra/items-in-group` in both linters. */
23
+ export declare const plugin: {
24
+ meta: {
25
+ name: string;
26
+ };
27
+ rules: {
28
+ "component-limits": {
29
+ meta: import("eslint").Rule.RuleMetaData;
30
+ create(context: import("eslint").Rule.RuleContext): import("eslint").Rule.RuleListener;
31
+ };
32
+ "items-in-group": {
33
+ meta: import("eslint").Rule.RuleMetaData;
34
+ create(context: import("eslint").Rule.RuleContext): import("eslint").Rule.RuleListener;
35
+ };
36
+ };
37
+ };
38
+ export { type ComponentLimits, type ItemsInGroupOptions, plugin as default };
package/dist/index.mjs ADDED
@@ -0,0 +1,436 @@
1
+ // src/readers/nodes.ts
2
+ /** ESTree and the template ASTs discriminate every node by its `type`. */
3
+ function isNode(value, type) {
4
+ return typeof value === "object" && value !== null && "type" in value && value.type === type;
5
+ }
6
+ function parentOf(node) {
7
+ return typeof node === "object" && node !== null && "parent" in node ? node.parent : null;
8
+ }
9
+ /** Every string an expression can produce, or null when one of them is not a literal. */
10
+ function stringValues(expression) {
11
+ if (isNode(expression, "Literal")) return typeof expression.value === "string" ? [expression.value] : null;
12
+ if (isNode(expression, "TemplateLiteral")) {
13
+ const [quasi, ...rest] = expression.quasis;
14
+ return quasi && rest.length === 0 && typeof quasi.value.cooked === "string" ? [quasi.value.cooked] : null;
15
+ }
16
+ if (isNode(expression, "ConditionalExpression")) {
17
+ const consequent = stringValues(expression.consequent);
18
+ const alternate = stringValues(expression.alternate);
19
+ return consequent && alternate ? [...consequent, ...alternate] : null;
20
+ }
21
+ return null;
22
+ }
23
+ function importDeclarations(statements) {
24
+ return statements.filter((statement) => isNode(statement, "ImportDeclaration"));
25
+ }
26
+ function programBody(program) {
27
+ return typeof program === "object" && program !== null && "body" in program && Array.isArray(program.body) ? program.body : [];
28
+ }
29
+ // src/readers/jsx.ts
30
+ const LOOP_METHODS = /* @__PURE__ */ new Set(["map", "flatMap"]);
31
+ function objectName(name) {
32
+ if (name.type === "JSXIdentifier") return name.name;
33
+ if (name.type === "JSXNamespacedName") return null;
34
+ const object = objectName(name.object);
35
+ return object === null ? null : `${object}.${name.property.name}`;
36
+ }
37
+ /** Null for an intrinsic element such as `<div>`. */
38
+ function componentName$1(name) {
39
+ if (name.type === "JSXMemberExpression") return objectName(name);
40
+ if (name.type === "JSXIdentifier" && /^[A-Z]/.test(name.name)) return name.name;
41
+ return null;
42
+ }
43
+ function staticText$2(children) {
44
+ return children.map((child) => {
45
+ if (child.type === "JSXText") return child.value;
46
+ if (child.type === "JSXElement" || child.type === "JSXFragment") return staticText$2(child.children);
47
+ return "";
48
+ }).join("");
49
+ }
50
+ function variantOf$2(element) {
51
+ const attributes = element.openingElement.attributes;
52
+ const variant = attributes.find((attribute) => attribute.type === "JSXAttribute" && attribute.name.name === "variant");
53
+ if (!variant) return attributes.some((attribute) => attribute.type === "JSXSpreadAttribute") ? { kind: "unknown" } : { kind: "unset" };
54
+ const value = variant.value;
55
+ const values = value?.type === "JSXExpressionContainer" ? stringValues(value.expression) : stringValues(value);
56
+ return values ? {
57
+ kind: "values",
58
+ values
59
+ } : { kind: "unknown" };
60
+ }
61
+ function isLoopCallback(node) {
62
+ if (!isNode(node, "ArrowFunctionExpression") && !isNode(node, "FunctionExpression")) return false;
63
+ const call = parentOf(node);
64
+ if (!isNode(call, "CallExpression")) return false;
65
+ const callee = call.callee;
66
+ return call.arguments.includes(node) && callee.type === "MemberExpression" && callee.property.type === "Identifier" && LOOP_METHODS.has(callee.property.name);
67
+ }
68
+ function read$2(node) {
69
+ if (!isNode(node, "JSXElement")) return null;
70
+ const name = componentName$1(node.openingElement.name);
71
+ if (!name) return null;
72
+ return {
73
+ name,
74
+ loc: node.openingElement.loc,
75
+ staticText: () => staticText$2(node.children),
76
+ variant: () => variantOf$2(node),
77
+ insideLoop() {
78
+ for (let parent = parentOf(node); parent; parent = parentOf(parent)) if (isLoopCallback(parent)) return true;
79
+ return false;
80
+ },
81
+ ancestorNames() {
82
+ const names = [];
83
+ for (let parent = parentOf(node); parent; parent = parentOf(parent)) {
84
+ if (!isNode(parent, "JSXElement")) continue;
85
+ const ancestor = componentName$1(parent.openingElement.name);
86
+ if (ancestor) names.push(ancestor);
87
+ }
88
+ return names;
89
+ }
90
+ };
91
+ }
92
+ const jsxReader = {
93
+ elementType: "JSXElement",
94
+ read: read$2,
95
+ imports: (program) => importDeclarations(programBody(program))
96
+ };
97
+ // src/readers/svelte.ts
98
+ function tagName(name) {
99
+ if (name.type === "SvelteMemberExpressionName") return `${tagName(name.object)}.${name.property.name}`;
100
+ return name.name;
101
+ }
102
+ function staticText$1(children) {
103
+ return children.map((child) => {
104
+ if (child.type === "SvelteText") return child.value;
105
+ if (child.type === "SvelteElement") return staticText$1(child.children);
106
+ return "";
107
+ }).join("");
108
+ }
109
+ function variantOf$1(element) {
110
+ const attributes = element.startTag.attributes;
111
+ const variant = attributes.find((attribute) => attribute.type === "SvelteAttribute" && attribute.key.name === "variant");
112
+ if (!variant) return attributes.some((attribute) => attribute.type === "SvelteSpreadAttribute" || attribute.type === "SvelteShorthandAttribute" && attribute.key.name === "variant") ? { kind: "unknown" } : { kind: "unset" };
113
+ const [value, ...rest] = variant.value;
114
+ if (!value || rest.length > 0) return { kind: "unknown" };
115
+ const values = value.type === "SvelteLiteral" ? [value.value] : value.type === "SvelteMustacheTag" ? stringValues(value.expression) : null;
116
+ return values ? {
117
+ kind: "values",
118
+ values
119
+ } : { kind: "unknown" };
120
+ }
121
+ function read$1(node) {
122
+ if (!isNode(node, "SvelteElement") || node.kind !== "component") return null;
123
+ return {
124
+ name: tagName(node.name),
125
+ loc: node.startTag.loc,
126
+ staticText: () => staticText$1(node.children),
127
+ variant: () => variantOf$1(node),
128
+ insideLoop() {
129
+ for (let parent = parentOf(node); parent; parent = parentOf(parent)) if (isNode(parent, "SvelteEachBlock")) return true;
130
+ return false;
131
+ },
132
+ ancestorNames() {
133
+ const names = [];
134
+ for (let parent = parentOf(node); parent; parent = parentOf(parent)) if (isNode(parent, "SvelteElement") && parent.kind === "component") names.push(tagName(parent.name));
135
+ return names;
136
+ }
137
+ };
138
+ }
139
+ const svelteReader = {
140
+ elementType: "SvelteElement",
141
+ read: read$1,
142
+ imports: (program) => programBody(program).flatMap((statement) => isNode(statement, "SvelteScriptElement") ? importDeclarations(statement.body) : importDeclarations([statement]))
143
+ };
144
+ // src/readers/vue.ts
145
+ function pascalCase(name) {
146
+ return name.split("-").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
147
+ }
148
+ /** Null for an intrinsic element. `<select-item>` is the `SelectItem` the script imported. */
149
+ function componentName(element) {
150
+ const raw = element.rawName;
151
+ if (raw.includes(".") || /^[A-Z]/.test(raw)) return raw;
152
+ return raw.includes("-") ? pascalCase(raw) : null;
153
+ }
154
+ function staticText(children) {
155
+ return children.map((child) => {
156
+ if (child.type === "VText") return child.value;
157
+ if (child.type === "VElement") return staticText(child.children);
158
+ return "";
159
+ }).join("");
160
+ }
161
+ function directive(attribute, name) {
162
+ return attribute.directive && attribute.key.name.name === name ? attribute : null;
163
+ }
164
+ function boundName(attribute) {
165
+ const argument = attribute.key.argument;
166
+ return argument?.type === "VIdentifier" ? argument.name : null;
167
+ }
168
+ function variantOf(element) {
169
+ const attributes = element.startTag.attributes;
170
+ for (const attribute of attributes) {
171
+ if (!attribute.directive && attribute.key.name === "variant") return attribute.value ? {
172
+ kind: "values",
173
+ values: [attribute.value.value]
174
+ } : { kind: "unknown" };
175
+ const bind = directive(attribute, "bind");
176
+ if (bind && boundName(bind) === "variant") {
177
+ const values = stringValues(bind.value?.expression);
178
+ return values ? {
179
+ kind: "values",
180
+ values
181
+ } : { kind: "unknown" };
182
+ }
183
+ }
184
+ return attributes.some((attribute) => {
185
+ const bind = directive(attribute, "bind");
186
+ return bind !== null && bind.key.argument === null;
187
+ }) ? { kind: "unknown" } : { kind: "unset" };
188
+ }
189
+ function hasFor(element) {
190
+ return element.startTag.attributes.some((attribute) => directive(attribute, "for") !== null);
191
+ }
192
+ function read(node) {
193
+ if (!isNode(node, "VElement")) return null;
194
+ const name = componentName(node);
195
+ if (!name) return null;
196
+ return {
197
+ name,
198
+ loc: node.startTag.loc,
199
+ staticText: () => staticText(node.children),
200
+ variant: () => variantOf(node),
201
+ insideLoop() {
202
+ for (let element = node; element; element = parentOf(element)) if (isNode(element, "VElement") && hasFor(element)) return true;
203
+ return false;
204
+ },
205
+ ancestorNames() {
206
+ const names = [];
207
+ for (let parent = parentOf(node); parent; parent = parentOf(parent)) {
208
+ if (!isNode(parent, "VElement")) continue;
209
+ const ancestor = componentName(parent);
210
+ if (ancestor) names.push(ancestor);
211
+ }
212
+ return names;
213
+ }
214
+ };
215
+ }
216
+ const vueReader = {
217
+ elementType: "VElement",
218
+ read,
219
+ imports: (program) => importDeclarations(programBody(program))
220
+ };
221
+ // src/readers/index.ts
222
+ /** vue-eslint-parser keeps the template out of the script AST and visits it only through this service. */
223
+ function hasTemplateBody(services) {
224
+ return typeof services === "object" && services !== null && "defineTemplateBodyVisitor" in services && typeof services.defineTemplateBodyVisitor === "function";
225
+ }
226
+ function isSvelte(services) {
227
+ return typeof services === "object" && services !== null && "isSvelte" in services && services.isSvelte === true;
228
+ }
229
+ /** The parser decides: each template language has its own node types. */
230
+ function readerFor(services) {
231
+ if (hasTemplateBody(services)) return vueReader;
232
+ if (isSvelte(services)) return svelteReader;
233
+ return jsxReader;
234
+ }
235
+ function importsOf(context) {
236
+ return readerFor(context.sourceCode.parserServices).imports(context.sourceCode.ast);
237
+ }
238
+ function visitComponents(context, visit) {
239
+ const services = context.sourceCode.parserServices;
240
+ const reader = readerFor(services);
241
+ const visitors = { [reader.elementType](node) {
242
+ const element = reader.read(node);
243
+ if (element) visit(element);
244
+ } };
245
+ return hasTemplateBody(services) ? services.defineTemplateBodyVisitor(visitors) : visitors;
246
+ }
247
+ // src/rules/component-limits.ts
248
+ const DEFAULT_VARIANT = "default";
249
+ function variantNames(variant) {
250
+ switch (variant.kind) {
251
+ case "unset": return [DEFAULT_VARIANT];
252
+ case "values": return variant.values;
253
+ case "unknown": return [];
254
+ default: return variant;
255
+ }
256
+ }
257
+ const componentLimits = {
258
+ meta: {
259
+ type: "suggestion",
260
+ docs: {
261
+ description: "Enforce per-component limits: the most characters of static text, and the most uses of a variant in one file.",
262
+ url: "https://github.com/salasebas/shadcn-lint-extra/blob/main/docs/rules/component-limits.md"
263
+ },
264
+ schema: [{
265
+ type: "object",
266
+ additionalProperties: {
267
+ type: "object",
268
+ additionalProperties: false,
269
+ properties: {
270
+ maxTextLength: {
271
+ type: "integer",
272
+ minimum: 1
273
+ },
274
+ maxPerVariant: {
275
+ type: "object",
276
+ additionalProperties: {
277
+ type: "integer",
278
+ minimum: 0
279
+ }
280
+ }
281
+ }
282
+ }
283
+ }],
284
+ messages: {
285
+ tooLong: "{{component}} text is {{length}} characters; the limit is {{max}}. Shorten the copy.",
286
+ tooMany: "A file may use {{component}} variant=\"{{variant}}\" at most {{max}} time(s); this is use {{count}}.",
287
+ repeated: "{{component}} variant=\"{{variant}}\" is limited to {{max}} per file, so it cannot render once per item of a loop."
288
+ }
289
+ },
290
+ create(context) {
291
+ const limits = context.options[0] ?? {};
292
+ const counts = /* @__PURE__ */ new Map();
293
+ return visitComponents(context, (element) => {
294
+ const component = element.name;
295
+ const limit = limits[component];
296
+ if (!limit) return;
297
+ const loc = element.loc;
298
+ if (limit.maxTextLength !== void 0) {
299
+ const length = [...element.staticText().replace(/\s+/g, " ").trim()].length;
300
+ if (length > limit.maxTextLength) context.report({
301
+ loc,
302
+ messageId: "tooLong",
303
+ data: {
304
+ component,
305
+ length: String(length),
306
+ max: String(limit.maxTextLength)
307
+ }
308
+ });
309
+ }
310
+ for (const variant of variantNames(element.variant())) {
311
+ const max = limit.maxPerVariant?.[variant];
312
+ if (max === void 0) continue;
313
+ const data = {
314
+ component,
315
+ variant,
316
+ max: String(max)
317
+ };
318
+ if (element.insideLoop()) {
319
+ context.report({
320
+ loc,
321
+ messageId: "repeated",
322
+ data
323
+ });
324
+ continue;
325
+ }
326
+ const key = `${component}:${variant}`;
327
+ const count = (counts.get(key) ?? 0) + 1;
328
+ counts.set(key, count);
329
+ if (count > max) context.report({
330
+ loc,
331
+ messageId: "tooMany",
332
+ data: {
333
+ ...data,
334
+ count: String(count)
335
+ }
336
+ });
337
+ }
338
+ });
339
+ }
340
+ };
341
+ // src/rules/items-in-group.ts
342
+ const DEFAULT_COMPONENT_IMPORTS = ["^@/components/ui/", "^\\$lib/components/ui/"];
343
+ const FAMILY_MODULES = {
344
+ select: "Select",
345
+ command: "Command"
346
+ };
347
+ const ITEM_EXPORTS = {
348
+ Select: ["Item", "SelectItem"],
349
+ Command: [
350
+ "Item",
351
+ "LinkItem",
352
+ "CommandItem",
353
+ "CommandLinkItem"
354
+ ]
355
+ };
356
+ const GROUP_EXPORTS = {
357
+ Select: ["Group", "SelectGroup"],
358
+ Command: ["Group", "CommandGroup"]
359
+ };
360
+ /** `@/components/ui/select/index.js` and `@/components/ui/select` both name `select`. */
361
+ function moduleName(source) {
362
+ return source.replace(/\/index(\.[cm]?[jt]s)?$/, "").split("/").at(-1) ?? "";
363
+ }
364
+ function familyNames(imports, patterns) {
365
+ const items = /* @__PURE__ */ new Map();
366
+ const groups = /* @__PURE__ */ new Map();
367
+ for (const declaration of imports) {
368
+ const source = declaration.source.value;
369
+ if (typeof source !== "string" || !patterns.some((pattern) => pattern.test(source))) continue;
370
+ const family = FAMILY_MODULES[moduleName(source)];
371
+ if (!family) continue;
372
+ for (const specifier of declaration.specifiers) {
373
+ const local = specifier.local.name;
374
+ if (specifier.type === "ImportNamespaceSpecifier") {
375
+ for (const name of ITEM_EXPORTS[family]) items.set(`${local}.${name}`, family);
376
+ for (const name of GROUP_EXPORTS[family]) groups.set(`${local}.${name}`, family);
377
+ } else if (specifier.type === "ImportSpecifier") {
378
+ const imported = specifier.imported.type === "Identifier" ? specifier.imported.name : String(specifier.imported.value);
379
+ if (ITEM_EXPORTS[family].includes(imported)) items.set(local, family);
380
+ if (GROUP_EXPORTS[family].includes(imported)) groups.set(local, family);
381
+ }
382
+ }
383
+ }
384
+ return {
385
+ items,
386
+ groups
387
+ };
388
+ }
389
+ // src/index.ts
390
+ const rules = {
391
+ "component-limits": componentLimits,
392
+ "items-in-group": {
393
+ meta: {
394
+ type: "problem",
395
+ docs: {
396
+ description: "Require Select and Command items inside their group, which carries the menu's padding.",
397
+ url: "https://github.com/salasebas/shadcn-lint-extra/blob/main/docs/rules/items-in-group.md"
398
+ },
399
+ schema: [{
400
+ type: "object",
401
+ additionalProperties: false,
402
+ properties: { componentImports: {
403
+ type: "array",
404
+ items: {
405
+ type: "string",
406
+ minLength: 1
407
+ }
408
+ } }
409
+ }],
410
+ messages: { outsideGroup: "Put {{item}} inside a {{family}} group. The group carries the menu's padding, so an item outside it touches the menu's edges." }
411
+ },
412
+ create(context) {
413
+ const patterns = ((context.options[0] ?? {}).componentImports ?? DEFAULT_COMPONENT_IMPORTS).map((pattern) => new RegExp(pattern));
414
+ const { items, groups } = familyNames(importsOf(context), patterns);
415
+ return visitComponents(context, (element) => {
416
+ const family = items.get(element.name);
417
+ if (!family) return;
418
+ if (element.ancestorNames().some((name) => groups.get(name) === family)) return;
419
+ context.report({
420
+ loc: element.loc,
421
+ messageId: "outsideGroup",
422
+ data: {
423
+ item: element.name,
424
+ family
425
+ }
426
+ });
427
+ });
428
+ }
429
+ }
430
+ };
431
+ /** `meta.name` is the rule namespace in Oxlint, so rule IDs read `shadcn-extra/items-in-group` in both linters. */
432
+ const plugin = {
433
+ meta: { name: "shadcn-extra" },
434
+ rules
435
+ };
436
+ export { plugin as default, plugin, rules };
package/package.json CHANGED
@@ -1,6 +1,80 @@
1
1
  {
2
2
  "name": "@salasebas/shadcn-lint-extra",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Extra shadcn/ui lint rules for ESLint and Oxlint, to use next to @shadcn/lint. Works with React, Svelte, and Vue.",
5
+ "keywords": [
6
+ "design-system",
7
+ "eslint",
8
+ "eslint-plugin",
9
+ "eslintplugin",
10
+ "lint",
11
+ "oxlint",
12
+ "react",
13
+ "shadcn",
14
+ "shadcn-svelte",
15
+ "shadcn-ui",
16
+ "shadcn-vue",
17
+ "svelte",
18
+ "vue"
19
+ ],
20
+ "homepage": "https://github.com/salasebas/shadcn-lint-extra#readme",
21
+ "bugs": {
22
+ "url": "https://github.com/salasebas/shadcn-lint-extra/issues"
23
+ },
24
+ "license": "MIT",
25
+ "author": "salasebas",
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/salasebas/shadcn-lint-extra.git"
29
+ },
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "type": "module",
34
+ "sideEffects": false,
35
+ "types": "./dist/index.d.mts",
36
+ "exports": {
37
+ ".": {
38
+ "types": "./dist/index.d.mts",
39
+ "default": "./dist/index.mjs"
40
+ },
41
+ "./package.json": "./package.json"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public"
45
+ },
46
+ "devDependencies": {
47
+ "@types/estree": "^1.0.11",
48
+ "@types/node": "^26.6.11",
49
+ "@typescript-eslint/parser": "^8.74.0",
50
+ "@typescript-eslint/types": "^8.74.0",
51
+ "eslint": "^10.16.0",
52
+ "oxfmt": "^0.81.0",
53
+ "oxlint": "^1.96.0",
54
+ "svelte": "^5.60.2",
55
+ "svelte-eslint-parser": "^1.13.0",
56
+ "tsdown": "^0.23.8",
57
+ "typescript": "^6.0.3",
58
+ "vitest": "^5.1.2",
59
+ "vue-eslint-parser": "^10.5.1"
60
+ },
61
+ "peerDependencies": {
62
+ "eslint": ">=9.0.0"
63
+ },
64
+ "peerDependenciesMeta": {
65
+ "eslint": {
66
+ "optional": true
67
+ }
68
+ },
69
+ "engines": {
70
+ "node": ">=20.19"
71
+ },
72
+ "scripts": {
73
+ "build": "tsdown",
74
+ "typecheck": "tsc --noEmit",
75
+ "test": "tsdown && vitest run",
76
+ "lint": "oxlint",
77
+ "fmt": "oxfmt",
78
+ "fmt:check": "oxfmt --check"
79
+ }
6
80
  }