mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
21 lines
532 B
JavaScript
21 lines
532 B
JavaScript
const fs = require("node:fs");
|
|
const input = JSON.parse(fs.readFileSync("/dev/stdin", "utf8"));
|
|
const filePath = input.tool_input?.file_path || "";
|
|
|
|
const protectedPatterns = [
|
|
/biome\.json$/,
|
|
/\.eslintrc/,
|
|
/eslint\.config/,
|
|
/\.prettierrc/,
|
|
/prettier\.config/,
|
|
/tsconfig.*\.json$/,
|
|
/\.editorconfig$/,
|
|
];
|
|
|
|
if (protectedPatterns.some((p) => p.test(filePath))) {
|
|
console.log(
|
|
`BLOCKED: Cannot modify config file "${filePath}". Fix the code to match the config, not the other way around.`,
|
|
);
|
|
process.exit(2);
|
|
}
|