lint-blame
raw JSON → 0.0.11 verified Fri May 01 auth: no javascript abandoned
A CLI tool (v0.0.11, low-activity) that filters linter output by blaming lines to specific authors or dates, enabling incremental adoption of new lint rules without rewriting the entire codebase. It pipes linter output (e.g., TSLint) and parses complaint formats (tslint4, tslint5, tsconfig), then uses git blame to retain only those lines matching a set of members or a since date. Unmaintained since 2020, no updates for Node >=10+ compatibility issues.
Common errors
error Error: Cannot find module 'lint-blame' ↓
cause Package not installed or not in node_modules.
fix
npm install lint-blame
error TypeError: Cannot read property 'match' of undefined ↓
cause The linter output format does not match expected pattern.
fix
Verify the --format flag matches your linter output (tslint4/tslint5/tsconfig).
error Fatal error: Not a git repository (or any of the parent directories): .git ↓
cause The command must be run from within a git repository.
fix
Change to a git repository directory or initialize one with 'git init'.
Warnings
gotcha Requires git repository with .git directory; fails silently if not in a git repo. ↓
fix Run the tool from within a git repository.
deprecated Only supports TSLint formats (tslint4, tslint5, tsconfig); no ESLint or other linter support. ↓
fix Use lint-staged or eslint-filtered-files instead for modern linting.
breaking Option '--members' requires both name and email; missing fields cause crash. ↓
fix Ensure each member object includes both 'name' and 'email'.
gotcha Pipe input must be the linter's stdout; reading from file not directly supported. ↓
fix Use shell redirection: cat lint-output.txt | lint-blame ...
Install
npm install lint-blame yarn add lint-blame pnpm add lint-blame Imports
- default wrong
const blameLint = require('lint-blame')correctimport blameLint from 'lint-blame' - LintBlameOptions
import { LintBlameOptions } from 'lint-blame'
Quickstart
import blameLint from 'lint-blame';
import { readFileSync } from 'fs';
const tslintOutput = readFileSync('/dev/stdin', 'utf8');
const options = {
format: 'tslint5',
since: '2023-01-01',
members: [{ name: 'Developer', email: 'dev@example.com' }]
};
const filtered = blameLint(tslintOutput, options);
console.log(filtered);