what-to-cook/scripts/lint.mjs
Peppa 164c5e00cb WTC-1: страница «Что приготовить сегодня»
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 05:49:18 +05:00

12 lines
369 B
JavaScript

import { readdirSync } from "node:fs";
import { spawnSync } from "node:child_process";
let bad = 0;
for (const dir of ["src", "scripts", "test"]) {
for (const f of readdirSync(dir)) {
if (!/\.m?js$/.test(f)) continue;
const r = spawnSync(process.execPath, ["--check", `${dir}/${f}`], { stdio: "inherit" });
if (r.status) bad = 1;
}
}
process.exit(bad);