chore: Enhance daily design system audit script and config

- Add `audit` script to `package.json` to run `scripts/daily-design-system-audit.mjs`.
- Update `lint:css` to include `css/docs.css` for better coverage.
- Improve `scripts/daily-design-system-audit.mjs` parsing logic for Hex and CSS violations to better handle output formats.
- Generate `REMEDIATION_REPORT.md` with current audit results (No violations).

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-01-29 16:05:37 +00:00
1 parent ad6bd60f89
commit 83622c53ef
2 files changed
+27 -12

No files matched your search

+25 -11
View File
@@ -38,8 +38,9 @@ function parseOutput(category, output) {
const violations = [];
if (category === "Hex Colors") {
// ./js/ui/ambientBackground.js:34: return "#000000";
const regex = /^(\.\/.*):(\d+):(.*)$/;
// js/ui/ambientBackground.js:34: return "#000000";
// Also supports ./ prefix if present
const regex = /^(.+?):(\d+):(.*)$/;
for (const line of lines) {
const match = line.trim().match(regex);
if (match) {
@@ -101,15 +102,28 @@ function parseOutput(category, output) {
// stylelint output
// css/tailwind.source.css
// 5757:3 ✖ Expected ...
// Just capture raw lines for now if we can't parse easily
// But since stylelint passed in my tests, I might not need complex parsing yet.
// If it fails, I'll just dump the output.
if (output.includes("✖") || output.includes("error")) {
violations.push({
file: "stylelint output",
line: 0,
snippet: output.trim() // Simplification
});
let currentFile = "";
for (const line of lines) {
const trimmed = line.trim();
// If line looks like a file path (ends with .css) and isn't an error line
if (trimmed.endsWith(".css") && !trimmed.includes("✖")) {
currentFile = trimmed;
} else {
const match = trimmed.match(/^(\d+):(\d+)\s+✖\s+(.+)$/);
if (match && currentFile) {
violations.push({
file: currentFile,
line: match[1],
snippet: match[3]
});
} else if (trimmed.includes("✖")) {
violations.push({
file: currentFile || "unknown",
line: 0,
snippet: trimmed
});
}
}
}
}