fix(client): normalise validate-styles paths so the allowlist matches on Windows (#914)

validate-styles.mjs compared path.relative() output against POSIX-style
ALLOWED keys. On Windows path.relative() yields backslashes, so the lookup
never matched: the allowlisted views/NotFoundView.vue was reported as a
violation and its allowlist entry was simultaneously reported as unused.
That made verify:fast fail on a clean checkout on Windows, which in turn
made the husky pre-push hook fail.

Fixes #824

Co-authored-by: andysom25 <7364828+andysom25@users.noreply.github.com>
This commit is contained in:
andysom25
2026-08-06 19:17:06 -04:00
committed by GitHub
parent 9b274cbae0
commit d8809d1f15
+2 -1
View File
@@ -58,7 +58,8 @@ const errors = []
const unusedAllowances = new Set(ALLOWED.keys())
for (const file of await sourceFiles(sourceDirectory)) {
const relativePath = path.relative(sourceDirectory, file)
// normalise separators so the ALLOWED keys (POSIX-style) also match on Windows
const relativePath = path.relative(sourceDirectory, file).split(path.sep).join('/')
const source = await readFile(file, 'utf8')
const lines = source.split('\n')