--deny warnings was a no-op (not a valid category); the correct flag is --deny-warnings. Fixed all 8 pre-existing warnings and removed every biome-ignore from source and test files. Simplified the check script to zero-tolerance: any biome-ignore now fails the build. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
42 lines
989 B
JavaScript
42 lines
989 B
JavaScript
/**
|
|
* Zero-tolerance check for biome-ignore comments.
|
|
*
|
|
* Any `biome-ignore` in tracked .ts/.tsx files fails the build.
|
|
* Fix the underlying issue instead of suppressing the rule.
|
|
*/
|
|
|
|
import { execSync } from "node:child_process";
|
|
import { readFileSync } from "node:fs";
|
|
|
|
const IGNORE_PATTERN = /biome-ignore\s+([\w/]+)/;
|
|
|
|
function findFiles() {
|
|
return execSync("git ls-files -- '*.ts' '*.tsx'", { encoding: "utf-8" })
|
|
.trim()
|
|
.split("\n")
|
|
.filter(Boolean);
|
|
}
|
|
|
|
let count = 0;
|
|
|
|
for (const file of findFiles()) {
|
|
const lines = readFileSync(file, "utf-8").split("\n");
|
|
|
|
for (let i = 0; i < lines.length; i++) {
|
|
const match = lines[i].match(IGNORE_PATTERN);
|
|
if (!match) continue;
|
|
|
|
count++;
|
|
console.error(`FORBIDDEN: ${file}:${i + 1} — biome-ignore ${match[1]}`);
|
|
}
|
|
}
|
|
|
|
if (count > 0) {
|
|
console.error(
|
|
`\n${count} biome-ignore comment(s) found. Fix the issue or restructure the code.`,
|
|
);
|
|
process.exit(1);
|
|
} else {
|
|
console.log("biome-ignore: 0 — all clear.");
|
|
}
|