mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
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:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user