lint-unpushed

raw JSON →
0.5.2 verified Fri May 01 auth: no javascript

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.

error Error: Cannot find module 'lint-unpushed'
cause 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.
error sh: lint-unpushed: command not found
cause 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.
error git: 'lint-unpushed' is not a git command.
cause Confusing lint-unpushed with git-subcommand style.
fix
Use npx lint-unpushed-pre-push not git lint-unpushed.
breaking In 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`.
breaking v0.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.
deprecated Husky integration is deprecated in favor of the built-in install script (`lint-unpushed-install`).
fix Use `"prepare": "lint-unpushed-install"` instead of Husky.
gotcha If 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.
gotcha The 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.
npm install lint-unpushed
yarn add lint-unpushed
pnpm add lint-unpushed

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"
}