shadscan-vue 0.1.0 → 0.1.1
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/CHANGELOG.md +7 -0
- package/README.md +2 -0
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.1](https://github.com/vinayakkulkarni/shadscan-vue/compare/v0.1.0...v0.1.1) (2026-07-25)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Documentation
|
|
7
|
+
|
|
8
|
+
* point the package and readmes at the live site ([72c9546](https://github.com/vinayakkulkarni/shadscan-vue/commit/72c9546592d4d95474c4266b1e62f654f4f21320))
|
|
9
|
+
|
|
3
10
|
## 0.1.0 (2026-07-25)
|
|
4
11
|
|
|
5
12
|
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Deterministic checks. Evidence. Agent-ready fixes. Static audit — no AI required.
|
|
6
6
|
|
|
7
|
+
**[shadscan-vue.geoql.in](https://shadscan-vue.geoql.in)** — rule catalog, docs, and changelog.
|
|
8
|
+
|
|
7
9
|
`shadscan-vue` audits **shadcn-vue** (Vue 3 + Vite) and **shadcn-nuxt** (Nuxt 4)
|
|
8
10
|
applications for the fundamentals that are easy to skip and expensive to miss:
|
|
9
11
|
theme wiring, command menus, route and error states, accessible controls, form
|
package/dist/index.js
CHANGED
|
@@ -2803,9 +2803,19 @@ const baseIdentifier = (collection) => {
|
|
|
2803
2803
|
return /([A-Za-z_$][\w$]*)\s*$/u.exec(collection)?.[1];
|
|
2804
2804
|
};
|
|
2805
2805
|
/** True when the file's script region references the identifier. */
|
|
2806
|
+
const scriptSource = (file) => file.sfc?.descriptor.scriptSetup?.content ?? file.sfc?.descriptor.script?.content ?? "";
|
|
2806
2807
|
const scriptDefines = (file, identifier) => {
|
|
2807
|
-
|
|
2808
|
-
|
|
2808
|
+
return new RegExp(`\\b${identifier}\\b`, "u").test(scriptSource(file));
|
|
2809
|
+
};
|
|
2810
|
+
/**
|
|
2811
|
+
* A collection assigned a non-empty array literal at declaration cannot be
|
|
2812
|
+
* empty at runtime, so demanding an empty state for it reports a failure the
|
|
2813
|
+
* author cannot act on. Matches `const tabs = [` and typed forms such as
|
|
2814
|
+
* `const tabs: Tab[] = [`, then confirms the literal has at least one entry.
|
|
2815
|
+
*/
|
|
2816
|
+
const isStaticNonEmptyLiteral = (file, identifier) => {
|
|
2817
|
+
const declaration = new RegExp(`\\b(?:const|let|var)\\s+${identifier}\\b[^=]*=\\s*\\[\\s*([^\\]])`, "su").exec(scriptSource(file));
|
|
2818
|
+
return declaration !== null && declaration[1] !== void 0;
|
|
2809
2819
|
};
|
|
2810
2820
|
/** True when the file contains an empty-branch guard for the collection. */
|
|
2811
2821
|
const hasEmptyBranch = (fileText, collection, identifier) => {
|
|
@@ -2847,7 +2857,7 @@ const emptyStatePresent = {
|
|
|
2847
2857
|
if (collection === void 0) continue;
|
|
2848
2858
|
const identifier = baseIdentifier(collection);
|
|
2849
2859
|
if (identifier === void 0) continue;
|
|
2850
|
-
if (!scriptDefines(file, identifier)) continue;
|
|
2860
|
+
if (!scriptDefines(file, identifier) || isStaticNonEmptyLiteral(file, identifier)) continue;
|
|
2851
2861
|
if (hasEmptyBranch(file.text, collection, identifier)) continue;
|
|
2852
2862
|
failures.push({
|
|
2853
2863
|
message: `<${element.tag}> iterates \`${collection}\` with no empty-state branch in this file.`,
|
|
@@ -3225,7 +3235,7 @@ const buttonIconsHaveDataIcon = {
|
|
|
3225
3235
|
//#region src/rules/production-polish/metadata-title-description-complete.ts
|
|
3226
3236
|
const TITLE_PATTERN = /\b(?:title|titleTemplate)\s*:/u;
|
|
3227
3237
|
const DESCRIPTION_PATTERN = /\bdescription\s*:/u;
|
|
3228
|
-
const HEAD_CALL_PATTERN = /\b(?:useSeoMeta|useHead
|
|
3238
|
+
const HEAD_CALL_PATTERN = /\b(?:useSeoMeta|useHead)\s*\(/u;
|
|
3229
3239
|
const metadataTitleDescriptionComplete = {
|
|
3230
3240
|
id: "metadata-title-description-complete",
|
|
3231
3241
|
title: "Routable pages declare a title and description",
|