import { readdirSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; function files(path) { return readdirSync(path, { withFileTypes: true }).flatMap(entry => entry.isDirectory() ? files(join(path, entry.name)) : [join(path, entry.name)]); } let fields = 0, dates = 0; const errors = []; for (const path of files('src/app').filter(path => /\.(html|ts)$/.test(path) && !path.endsWith('.spec.ts'))) { const source = readFileSync(path, 'utf8'); for (const match of source.matchAll(/]*>[\s\S]*?<\/mat-form-field\s*>/g)) { fields++; if (!/]*\btype="(?:date|datetime-local)")[^>]*>/g)) { dates++; if (!source.slice(match.index + match[0].length).startsWith('