{"id":25872,"library":"lint-prepush","title":"lint-prepush","description":"lint-prepush is a Node.js tool that runs linters on staged files before a git push, enforcing code quality within teams. Current stable version is 3.0.3 (released 2024-11-30), with a slow release cadence. It uses a simple package.json configuration to define tasks per file glob, supports concurrent task execution for speed, and integrates with any git hook manager (e.g., Husky). Unlike lint-staged which operates on pre-commit, lint-prepush operates on pre-push, catching issues after local commits. Requires Node.js >=18.18.0. Dependencies include cosmiconfig for config loading, execa for running commands, and log-symbols for visual feedback. No security issues reported.","status":"active","version":"3.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/theenadayalank/lint-prepush","tags":["javascript","lint","lint-prepush","prepush","husky","linter","git","hooks"],"install":[{"cmd":"npm install lint-prepush","lang":"bash","label":"npm"},{"cmd":"yarn add lint-prepush","lang":"bash","label":"yarn"},{"cmd":"pnpm add lint-prepush","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This is a CLI tool, not a library. Use npx or run directly from node_modules/.bin.","wrong":"import lintPrep from 'lint-prepush'","symbol":"lint-prepush","correct":"npx lint-prepush"},{"note":"Configuration is placed in package.json under the 'lint-prepush' key, or in a separate .lintprepushrc file.","wrong":"require('lint-prepush').config(...)","symbol":"configuration","correct":"\"lint-prepush\": { \"tasks\": { \"*.js\": \"eslint\" } }"},{"note":"Husky v9+ uses .husky directory. Add a pre-push hook file that runs the command.","wrong":"// using in package.json scripts","symbol":"husky integration","correct":"// .husky/pre-push\nnpx lint-prepush"}],"quickstart":{"code":"npm install --save-dev lint-prepush husky\nnpm install --save-dev eslint  # or your linter\nnpx husky init  # creates .husky directory\necho 'npx lint-prepush' > .husky/pre-push\nchmod +x .husky/pre-push\n# Add to package.json:\n# \"lint-prepush\": {\n#   \"base\": \"main\",\n#   \"tasks\": {\n#     \"*.js\": [\"eslint\"]\n#   }\n# }","lang":"bash","description":"Install lint-prepush and Husky, create a pre-push hook, and configure lint tasks in package.json."},"warnings":[{"fix":"Update Node.js to >=18.18.0.","message":"Node version <18.18.0 is not supported. Upgrade to Node >=18.18.0.","severity":"breaking","affected_versions":"<3.0.0"},{"fix":"Use Node >=10 for v2.x. For current versions, use Node >=18.18.0.","message":"Drop support for Node.js <10 in v2.0.0 was a breaking change.","severity":"deprecated","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Explicitly set the 'base' option in configuration to your default branch (e.g., 'main').","message":"If base branch is not specified and the remote branch doesn't exist locally, lint-prepush may fail or use incorrect diff.","severity":"gotcha","affected_versions":"<3.0.0"},{"fix":"Use format: { \"concurrent\": [\"eslint\", \"jest\"] }","message":"Multiple tasks on same glob must be wrapped in an object with 'concurrent' key, not array of arrays.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use the object format with 'concurrent' for multiple tasks.","message":"Old configuration format with array of commands without 'concurrent' key is still supported but deprecated.","severity":"deprecated","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Add configuration: \"lint-prepush\": { \"tasks\": { \"*.js\": \"eslint\" } }","cause":"No 'lint-prepush' key in package.json and no .lintprepushrc file.","error":"Error: Could not find a configuration file for lint-prepush."},{"fix":"Set 'base' to an existing branch (e.g., 'main' or 'master') or omit to auto-detect (v3+).","cause":"The 'base' option points to a branch that doesn't exist locally.","error":"Error: The base branch 'main' does not exist locally or has no commits. Please specify a valid base branch."},{"fix":"Install the linter locally (npm install --save-dev eslint) or ensure it's globally accessible.","cause":"Linter not installed or not in PATH.","error":"command not found: eslint"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}