Initial curated projectbrain source from 8a7b1e0651dbdab97d744cbd2e653ab3970ac6c5
This commit is contained in:
commit
5aa3e8d685
700 files changed
+132801
No files matched your search
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env node
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
const root = resolve(import.meta.dirname, "..");
|
||||
const manifest = JSON.parse(await readFile(resolve(root, "package.json"), "utf8"));
|
||||
const command = manifest.scripts?.typecheck;
|
||||
const required = ["tsconfig.app.json", "tsconfig.node.json"];
|
||||
const missing = required.filter((config) => !command?.includes(`-p ${config}`));
|
||||
|
||||
if (missing.length) {
|
||||
console.error(`TypeScript gate does not compile: ${missing.join(", ")}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
for (const config of required) {
|
||||
const content = await readFile(resolve(root, config), "utf8");
|
||||
if (!/"noEmit"\s*:\s*true/.test(content) && !command.includes("--noEmit")) {
|
||||
console.error(`TypeScript gate may emit files for ${config}.`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
console.log("TypeScript gate covers application and Node configurations.");
|
||||
Reference in new issue
Block a user