Pre-Commit Lint

Runs ESLint and Prettier on staged files before each commit, blocking commits that introduce lint errors.

AuthorNeexoCore
Updated
Eventpre-commit
linteslintprettierquality

Overview

Automatically validates code quality before each commit. Runs ESLint and Prettier on staged files only — fast, targeted, and non-intrusive.

What It Does

  1. Intercepts git commit
  2. Runs lint-staged on staged .ts, .tsx, .js, .jsx files
  3. Blocks the commit if any lint errors are found
  4. Allows warnings to pass through

Configuration

Add to your lint-staged config:

{
  "*.{ts,tsx}": ["eslint --fix", "prettier --write"],
  "*.{js,jsx}": ["eslint --fix", "prettier --write"],
  "*.{json,md}": ["prettier --write"]
}

Raw content

Copy this into your project — e.g. .instructions.md, .agent.md, or SKILL.md

## Overview

Automatically validates code quality before each commit. Runs ESLint and Prettier on staged files only — fast, targeted, and non-intrusive.

## What It Does

1. Intercepts `git commit`
2. Runs `lint-staged` on staged `.ts`, `.tsx`, `.js`, `.jsx` files
3. Blocks the commit if any lint errors are found
4. Allows warnings to pass through

## Configuration

Add to your `lint-staged` config:

```json
{
  "*.{ts,tsx}": ["eslint --fix", "prettier --write"],
  "*.{js,jsx}": ["eslint --fix", "prettier --write"],
  "*.{json,md}": ["prettier --write"]
}
```