You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bundled src/cli/init/templates/eslint-config.ts writes a flat config that turns ON max-lines-per-function: 12 and max-lines: 200 for every file, including test files. habit-hooks' own rule layer (TEST_FILE_EXCLUDE in src/config/defaults.ts:172) correctly exempts tests from these rules when habit-hooks runs — but the consumer's direct eslint . / pnpm lint invocation sees the unmoderated config and fires on every test file.
We hit exactly this dogfooding the rules on this repo (134 violations, ~105 in tests). Phase A added a test-file override to eslint.config.js to bring direct lint into line with habit-hooks's documented exemption:
The bundled template should ship the same override, so a consumer who scaffolds a fresh setup doesn't immediately see pnpm lint failing on tests it should never have been checking against those thresholds.
Fix
Add the test-file override block to ESLINT_CONFIG_TEMPLATE in src/cli/init/templates/eslint-config.ts. Same glob list as TEST_FILE_EXCLUDE (['**/*.test.ts', '**/*.spec.ts', 'tests/**']) so the two layers agree.
Why this matters for the alpha
A first-time user who runs habit-hooks init and immediately runs pnpm lint will get a wall of test-file failures, which doesn't match the messaging in AGENT_SNIPPET or README. The init promise is "scaffold a sensible default" — this is the missing piece.
Activity
#9: exempt test files from size rules in init eslint template