ng-lint-report
raw JSON → 0.2.0 verified Fri May 01 auth: no javascript maintenance
Generates HTML reports from Angular CLI lint JSON output (0.2.0). Supports both TSLint and ESLint outputs. No active development; last release 2021. Simpler than alternatives like angular-eslint's built-in formatter — just converts JSON to a standalone HTML file.
Common errors
error Error: Cannot find module 'ng-lint-report' ↓
cause Missing local install; using require instead of npx.
fix
Install as dev dependency: npm install --save-dev ng-lint-report; then run via npx or npm scripts.
error ENOENT: no such file or directory, open '.../jsonOutput.json' ↓
cause JSON file not found at specified path.
fix
Ensure --jsonfile path is relative to project root or use absolute path. Example: --jsonfile ./reports/lint-results.json
error SyntaxError: Unexpected token < in JSON at position 0 ↓
cause Lint output contains HTML or error text instead of JSON.
fix
Use --format json flag with ng lint; ensure no other messages printed to stdout. Remove --silent temporarily to debug.
Warnings
deprecated Angular 13+ uses ESLint instead of TSLint; JSON output format may differ. ↓
fix Ensure lint command outputs valid JSON with message array; test with your Angular version.
gotcha Silent flag may hide lint errors. If --silent is used, exit code is always 0 even on lint failures. ↓
fix Consider omitting --silent or checking exit code separately. Use '|| true' after lint command to continue.
deprecated TSLint is deprecated; JSON output from TSLint has different shape than ESLint. ↓
fix If using ESLint, ensure JSON output has 'messages' array per file. Optionally switch to an ESLint-specific reporter.
gotcha Report only includes lint results from the JSON file; does not parse stdout or stderr. ↓
fix Pipe lint output to file as shown; ensure file is valid JSON.
Install
npm install ng-lint-report yarn add ng-lint-report pnpm add ng-lint-report Imports
- default (CLI) wrong
const report = require('ng-lint-report')correctnpx ng-lint-report --jsonfile path/to/output.json - CLI as npm script wrong
"report": "node ng-lint-report"correct"report": "ng-lint-report --jsonfile jsonOutput.json"
Quickstart
// package.json (add to scripts):
"scripts": {
"lint": "ng lint --format json --silent > jsonOutput.json",
"report": "ng-lint-report --jsonfile jsonOutput.json",
"ng-lint": "npm run lint && npm run report"
}
// Then run:
npm run ng-lint
// Report saved to ./ng-lint-report/report.html (default)