Registry / testing / lint-diff

lint-diff

JSON →
library1.2.1jsnpmunverified

lint-diff is a CLI tool that runs ESLint only on lines changed within a specified Git commit range, filtering out pre-existing lint errors. Version 1.2.1 is the latest stable release; the project appears to be in maintenance mode with no recent updates. It differs from lint-staged by working on committed changes, making it suitable for CI environments like Travis. Requires eslint 4.x as a peer dependency.

npm install lint-diff
INSTALL
IMPORT
SIG · LINT-DIFF
L
lint-diff
testingjavascriptv1.2.1
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-diff (CLI)
npx lint-diff HEAD~3..HEAD
lint-diff
The package provides a binary, not a programmatic API. Common mistake is running without a commit range; it defaults to HEAD.

Shows how to run lint-diff on the last 3 commits using npx.

npx lint-diff HEAD~3..HEAD
lint-diff --version
Debug
Known issues
gotchaESLint must be installed separately and configured via .eslintrc.
fix
Install eslint: npm install eslint --save-dev and ensure .eslintrc exists.
affects: >=1.0.0
breakingOnly eslint 4.x is supported as a peer dependency.
fix
Use eslint@4.x.
affects: >=1.0.0
gotchalint-diff fails silently if the git commit range is invalid or no changes are detected.
fix
Verify the commit range is correct and contains changes.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'eslint'
eslint is not installed.
fix
Run: npm install eslint@4.x --save-dev
Error: Cannot find module './lib/cli'
Missing or broken installation of eslint.
fix
Reinstall eslint and ensure it's in node_modules.
Upgrade
Version history
1.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

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