Registry / testing / lint-filter

lint-filter

JSON →
library1.7.3jsnpmunverified

A CLI tool that filters lint output (e.g., ESLint checkstyle) to show only errors/warnings on lines changed relative to a git branch (default master). Useful for gradually adopting strict lint rules without breaking existing code. Version 1.7.3 is stable, released 2016-5-17. Supports external formatters, environment variable configuration, and a 'list-files' subcommand for faster linting. Alternative to eslint-nibble or incremental linting approaches.

npm install lint-filter
INSTALL
IMPORT
SIG · LINT-FILTER
L
lint-filter
testingjavascriptv1.7.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

lint-filter
npx lint-filter --help
import lintFilter from 'lint-filter'
lint-filter is a CLI tool, not a library. Use npx or global install.

Shows how to install lint-filter, set up a minimal ESlint config, commit code, then see filtered lint output for only new lines.

npm install --save-dev lint-filter echo '{"rules":{"no-console":"error"}}' > .eslintrc.json # Create a file with lint errors echo 'console.log("hello");' > test.js git init && git add -A && git commit -m "init" # Introduce a change echo 'console.log("world");' >> test.js # Run eslint with checkstyle and pipe to lint-filter eslint . -f checkstyle | npx lint-filter
lint-filter --version
Debug
Known issues
gotchadiff-so-fancy compatibility: lint-filter may not detect lines correctly if you use diff-so-fancy. Works since v1.6.2.
fix
Upgrade to >=1.6.2 or avoid diff-so-fancy.
affects: <1.6.2
deprecatedThe 'require:' prefix for external formatters may not work as expected if the module path is relative.
fix
Use an absolute path or install the module globally.
affects: >=1.7.0
gotchaOnly lines that are changed, not context lines, are considered (since v1.6.3). This might miss errors on lines adjacent to changes.
fix
If you need context lines, consider writing a custom script or downgrade.
affects: >=1.6.3
Errors
Common errors & fixes
Error: Cannot find module 'bluebird'
Missing dependency bluebird (fixed in v1.0.1).
fix
Install lint-filter >=1.0.1 or manually install bluebird.
lint-filter: command not found
Global install or npx not used.
fix
Run 'npx lint-filter' or install globally with 'npm install -g lint-filter'.
Error: ENOENT: no such file or directory, open 'path/to/checkstyle-report.xml'
File path does not exist.
fix
Ensure the file exists or pipe input via stdin.
Upgrade
Version history
1.7.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
lint-filter — npm install lint-filter · libregistry