auto-git-lint

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

A global or project-level CLI tool that automatically runs ESLint and Prettier linting on staged files before Git commits. Version 1.0.12 is current but appears infrequently updated. It simplifies setup by providing a single 'auto-lint' command, wrapping common ESLint (including @typescript-eslint parser/plugin) and Prettier configurations. It aims to replace manual husky/lint-staged setups but offers limited customization and documentation.

error auto-lint: command not found
cause Package not installed globally or not in PATH.
fix
Install globally: npm install -g auto-git-lint. Or use npx: npx auto-lint.
error ESLint version mismatch: auto-git-lint requires ESLint ^7.0.0 but project uses ^8.0.0
cause Auto-installed dependency conflict.
fix
Uninstall global auto-git-lint and install locally. Manually set up ESLint and Prettier.
error Error: No staged files found. Please stage your changes first.
cause No files staged via git add.
fix
Stage files: git add <file> or git add -A; then run auto-lint.
gotcha auto-lint command only works with staged files via git diff; it does not lint entire project.
fix Ensure you have staged changes before running 'auto-lint'.
gotcha The package may automatically install ESLint and Prettier dependencies globally. This can lead to version conflicts with existing project setups.
fix Use project-local installation and manage dependencies manually.
deprecated The package appears unmaintained since 2022. No support for newer ESLint flat config or Prettier v3.
fix Consider alternatives like husky + lint-staged or lefthook.
npm install auto-git-lint
yarn add auto-git-lint
pnpm add auto-git-lint

Installs the tool globally or as a dev dependency, then runs 'auto-lint' in a project to lint staged files.

# Install globally
npm install -g auto-git-lint
# Or in project
npm install --save-dev auto-git-lint

# Run lint on staged files using git diff
cd your-project
auto-lint