Registry / testing / lint-unpushed

lint-unpushed

JSON →
library0.5.2jsnpmunverified

Lints or runs tests on only the files that have changed since the last push, using git to detect differences. Version 0.5.2 is the latest stable release. It integrates via git hooks (husky or built-in install script) and replaces #FILES# placeholders with changed file paths. Compared to lint-staged, it triggers on push rather than commit, allowing broader pre-push checks including full project type-checking. Written in JavaScript, ESM-only since v0.4.0, requires Node >= 10. Maintained by Steelbrain; fixes for Windows and stash handling were added in recent versions.

npm install lint-unpushed
INSTALL
IMPORT
SIG · LINT-UNPUSHED
L
lint-unpushed
testingjavascriptv0.5.2
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.

no main module export
npx lint-unpushed-pre-push
require('lint-unpushed')
Package provides CLI binaries only, no programmatic API. Use npm scripts or direct CLI.
prepare script binary
"prepare": "lint-unpushed-install"
"prepare": "node node_modules/.bin/lint-unpushed-install"
The install binary auto-configures git hooks; avoid manual paths.

Install and configure lint-unpushed to run ESLint on changed JS/TS files plus full TypeScript check on push.

npm install --save-dev lint-unpushed # Add to package.json scripts: "prepare": "lint-unpushed-install" # Configure in package.json: "lint-unpushed": { "**/*.{js,ts}": "eslint #FILES#", "**/*.{ts,tsx}": "tsc -p . --noEmit" }
lint-unpushed --version
Debug
Known issues
breakingIn v0.5.0 the binary was renamed from `lint-unpushed` to `lint-unpushed-pre-push`.
fix
Update any scripts or hooks that reference `lint-unpushed` to `lint-unpushed-pre-push`.
affects: >=0.5.0
breakingv0.3.0 changed arguments from array to object, and #FILES# placeholder became required.
fix
Update config to Record<string, string|string[]> and include #FILES# where file list is needed.
affects: >=0.3.0
deprecatedHusky integration is deprecated in favor of the built-in install script (`lint-unpushed-install`).
fix
Use `"prepare": "lint-unpushed-install"` instead of Husky.
affects: >=0.5.0
gotchaIf your repository has no remote branch reference (e.g., fresh clone), lint-unpushed may fail to detect changes.
fix
Add a post-checkout hook using `lint-unpushed-post-checkout` to create the reference.
affects: *
gotchaThe tool stashes uncommitted changes before running lint; on some platforms (fixed in v0.5.2) the stash might not pop correctly.
fix
Upgrade to v0.5.2 or later.
affects: >=0.1.0 <0.5.2
Errors
Common errors & fixes
Error: Cannot find module 'lint-unpushed'
Trying to require the package as a module, but it only provides CLI binaries.
fix
Use npx lint-unpushed-pre-push or define commands in package.json scripts.
sh: lint-unpushed: command not found
Binary not in PATH because package is not installed or not in node_modules/.bin.
fix
Run `npm install --save-dev lint-unpushed` and use npx or specify path in scripts.
git: 'lint-unpushed' is not a git command.
Confusing lint-unpushed with git-subcommand style.
fix
Use `npx lint-unpushed-pre-push` not `git lint-unpushed`.
Upgrade
Version history
0.5.2latest on npm
Audit
Dependencies
gitrequiredUses git commands (diff, stash, etc.) to detect unpushed files
Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
lint-unpushed — npm install lint-unpushed · libregistry