Quickstart
Install
Requires Node.js >= 20.9.
Configure
Optionally create line-limits.json in the project root:
{
"warn": 500,
"error": 1000,
"scanDirs": ["src", "tests"],
"skipDirs": ["node_modules", ".git", "dist", "coverage"],
"exclude": ["**/*.d.ts", "**/*.generated.*"]
}
All keys are optional; the sample above matches the built-in defaults. See the LineLimitsConfig table for all options.
Run
Or add a script to package.json:
Output when all files pass:
Output when files exceed thresholds:
Warnings do not affect the exit code. Any file at or above error exits 1.
See also: API Reference for CLI flags and JSON output.