A fork of the pre-commit package (v1.2.5) that adds selective linting of only changed files in a commit. It integrates with stylelint and eslint by default, linting CSS/SCSS/Less and JS/JSX files respectively, with configurable patterns. Designed to speed up commits by avoiding full-project linting. Release cadence is low (last update 2017), and it's effectively unmaintained. Key differentiator vs original pre-commit: automatic linting of only staged changes. Alternative better-maintained packages exist.
npm install pre-commit-with-lintNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows full setup: install, configure package.json with selective lint and scripts, then commit. Verifies pre-commit hook runs lint and test before allowing commit.
Switch to @commitlint/lint-staged or husky + lint-staged.
Ensure listed linters (eslint, stylelint, tslint, etc.) are installed as devDependencies.
Set explicit patterns in package.json: { "pre-commit": { "lint": { "eslint": ".jsx?$" } } }Use object syntax with 'lint' and 'run' keys, not an array.
Install default linters or disable them via config: { "pre-commit": { "lint": { "eslint": "false" } } }Run: npm install eslint --save-dev; or disable eslint in package.json: "eslint": "false"
Check package.json pre-commit configuration, ensure scripts are valid, and reinstall the package.
Initialize a git repo: git init