Files
iistwin/scripts/check-file-sizes.ts
Ильяс Султанов 1f5ecb6da4 fix(number-fields): избегаем потери точности длинных чисел
- number-поля теперь рендерятся как text + inputMode=numeric,
  чтобы браузер не округлял значения через input type=number
- пробелы при вставке в number-поля удаляются
- бэкенд нормализует значения number-полей в строку перед сохранением
- добавлен хелпер normalizeFieldValueForStorage

Closes: искажение расчётного счёта и других длинных числовых полей
2026-07-07 21:03:40 +03:00

30 lines
802 B
TypeScript

import { readdirSync, readFileSync } from "fs";
import { join } from "path";
const ROUTES_DIR = "server/routes";
const LINE_LIMIT = 650;
const files = readdirSync(ROUTES_DIR).filter((f) => f.endsWith(".ts"));
let violations = 0;
for (const file of files) {
const filePath = join(ROUTES_DIR, file);
const lines = readFileSync(filePath, "utf-8").split("\n").length;
if (lines > LINE_LIMIT) {
console.error(
`❌ ${filePath}: ${lines} lines (limit is ${LINE_LIMIT})`
);
violations++;
}
}
if (violations > 0) {
console.error(
`\n${violations} file(s) exceed the ${LINE_LIMIT}-line limit. Split them into smaller modules before merging.`
);
process.exit(1);
} else {
console.log(`✅ All ${files.length} route files are within the ${LINE_LIMIT}-line limit.`);
}