From 0422c742f46bd6c33c318c073a11ec22a9a1acbb Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Tue, 14 Oct 2025 21:51:13 -0400 Subject: [PATCH] Expand design token lint coverage --- README.md | 4 ++++ scripts/check-design-tokens.mjs | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e7dfd53..4e965ac1 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,10 @@ hairline borders or browser reset quirks) add an explicit allowlist entry in `scripts/check-design-tokens.mjs` so future contributors understand why the constant exists. +The script now crawls every markup-emitting module under `js/blog`, `js/ui`, +`js/channelProfile.js`, and `torrent/ui`, so UI tweaks anywhere in the repo +benefit from the guard without manual configuration. + Beacon builds inherit the same rule. `npm run build:beacon` now bundles `torrent/dist` and immediately re-runs the inline-style checker against the fresh output so third-party dependencies cannot sneak inline style mutations diff --git a/scripts/check-design-tokens.mjs b/scripts/check-design-tokens.mjs index d109defd..aff78855 100755 --- a/scripts/check-design-tokens.mjs +++ b/scripts/check-design-tokens.mjs @@ -9,8 +9,9 @@ const __filename = fileURLToPath(import.meta.url); const __dirname = path.dirname(__filename); const repoRoot = path.resolve(__dirname, ".."); -const TARGET_DIRECTORIES = ["js/ui"]; +const TARGET_DIRECTORIES = ["js/blog", "js/ui", "torrent/ui"]; const TARGET_FILES = ["js/channelProfile.js", "css/tailwind.source.css"]; +const IGNORED_DIRECTORIES = new Set(["dist", "vendor"]); const IGNORED_EXTENSIONS = new Set([".min.js", ".map"]); const ALLOWED_FILES = new Set([ "js/ui/components/RevertModal.js", @@ -112,6 +113,9 @@ async function walkDirectory(dir, results) { for (const entry of entries) { const fullPath = path.join(dir, entry.name); if (entry.isDirectory()) { + if (IGNORED_DIRECTORIES.has(entry.name)) { + continue; + } await walkDirectory(fullPath, results); continue; }