feat: add max-lines guard with self-cleaning exemptions (RD-02)

The dashboard refactor proved a page can be 42 lines. This rule holds
the rest of the app to that budget, before the split work in RD-20
through RD-26 begins.

Add max-lines at 250 (skipBlankLines, skipComments), scoped to
{apps,libs}/**/*.{page,component,section,step}.ts. The glob includes
section and step, the file kinds the dashboard refactor invented, so
new files from this arc do not escape the guard.

Add linterOptions.reportUnusedDisableDirectives: 'error' repo-wide.
ESLint 9 only warns on an unused disable by default, so a stale
exemption would not fail the build. At 'error', every later file
split must delete its own exemption or the build goes red.

Add a dated /* eslint-disable max-lines */ header to each of the
seven files that exceed the budget today, each with a reason and the
ticket that removes it. letter-canvas keeps its disable after RD-26,
because most of its lines are CSS and the rest is one letter.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
eho
2026-09-04 16:18:10 +02:00
co-authored by Claude Sonnet 5
parent 97d9697a84
commit b9d572cfdc
10 changed files with 145 additions and 1 deletions
+19
View File
@@ -14,6 +14,13 @@ import angular from 'angular-eslint';
* `herregistratie` uncovered).
*/
export default [
// A disable directive that no rule needs any more is a lint failure, repo-wide (no
// `files` key, so this applies everywhere — ESLint 9 flat config rule). This forces
// every later file split in the readable-codebase arc (RD-02) to delete its own
// `max-lines` exemption instead of leaving it as permanent debt.
{
linterOptions: { reportUnusedDisableDirectives: 'error' },
},
{
ignores: [
'dist/**',
@@ -48,4 +55,16 @@ export default [
...c,
files: ['{apps,libs}/**/*.html'],
})),
// The dashboard refactor proved a page can be 42 lines. This rule holds the rest of
// the app to that budget: 250 is reachable, not a style-guide default. The glob must
// include `section` and `step` — the dashboard refactor's own file kinds — or every
// file this arc creates escapes the guard. Each exemption below names its reason and
// the ticket that removes it, so the list is a dated to-do, not silent debt.
{
files: ['{apps,libs}/**/*.{page,component,section,step}.ts'],
rules: {
'max-lines': ['error', { max: 250, skipBlankLines: true, skipComments: true }],
},
},
];