Skip to content
lintstagedrc logo

Lint-Staged Configuration Skill

lintstagedrc

Generates .lintstagedrc configuration to automatically fix and format staged files before commit. Runs ESLint, Stylelint, and Prettier on staged files.

SKILL.md

Full skill instructions

Lint-Staged Configuration Skill

Purpose

Generate lint-staged configuration to automatically fix and format staged files before commit.

🚨 MANDATORY FILE COUNT

This skill MUST create exactly 1 file:

  • .lintstagedrc.json (preferred format)

🔍 BEFORE GENERATING - CRITICAL RESEARCH REQUIRED

⚠️ HIGH PRIORITY: Verify current tool CLI flags to prevent outdated commands

Required Research Steps:

  1. ESLint CLI Flags: Verify eslint --fix is still the correct flag
    • Check if ESLint CLI has deprecated or changed flags
    • Verify --fix flag still works with current ESLint version
  2. Prettier CLI Flags: Verify prettier --write is still correct
    • Check if Prettier CLI has changed flags
    • Verify --write flag syntax hasn't changed
  3. Stylelint CLI (if project uses Stylelint):
    • Check package.json for stylelint dependency
    • If found: Verify stylelint --fix is correct flag
    • Include style file patterns in configuration
  4. File Patterns: Verify glob patterns work with lint-staged version
    • Check if pattern syntax has changed
    • Verify file extension support (jsx, tsx, css, scss)
  5. Command Chaining: Verify array of commands still executes sequentially
  6. Alternative Formats: Check if .lintstagedrc.json is still recommended format
    • Verify not deprecated in favor of .lintstagedrc.js or package.json field

Output

Create the file: .lintstagedrc.json

Supported Format:

  • .lintstagedrc.json (strict preferred format - simple JSON configuration)

Alternative Formats (only if JSON deprecated):

  • .lintstagedrc.js (JavaScript with dynamic logic)
  • lint-staged field in package.json
  • .lintstagedrc.cjs (CommonJS format)

Example File

See: examples.md in this directory for complete examples and detailed explanations.

⚠️ IMPORTANT: The examples.md file contains December 2025 configurations. Always verify current CLI flags before using.

Execution Checklist

  • Research current ESLint CLI flags (verify --fix)
  • Research current Prettier CLI flags (verify --write)
  • Check if project has Stylelint in package.json
  • If Stylelint found, verify stylelint --fix flag
  • Determine file patterns based on project needs (jsx/​tsx/​css/​scss)
  • Verify lint-staged glob pattern syntax hasn't changed
  • Create .lintstagedrc.json with appropriate commands and patterns
  • Verify JSON format is still recommended (not deprecated)

🛑 BLOCKING VALIDATION CHECKPOINT

STOP! Before proceeding to the next skill, verify:

Automated Verification

Run this command to verify the file exists:

if [ -f ".lintstagedrc.json" ] || [ -f ".lintstagedrc.js" ] || [ -f ".lintstagedrc.cjs" ] || grep -q "lint-staged" package.json 2>/​dev/​null; then
  echo "✓ Lint-staged configuration found"
  if [ -f ".lintstagedrc.json" ]; then
    echo "✓ Using .lintstagedrc.json (preferred format)"
    # Validate JSON syntax
    if command -v jq >/​dev/​null 2>&1; then
      jq empty .lintstagedrc.json && echo "✓ Valid JSON syntax" || echo "✗ Invalid JSON syntax"
    fi
  fi
else
  echo "✗ Lint-staged configuration missing"
  exit 1
fi

Manual Verification

  1. ✓ .lintstagedrc.json exists at project root
  2. ✓ File contains valid JSON syntax
  3. ✓ File includes ESLint command with current flags
  4. ✓ File includes Prettier command with current flags
  5. ✓ File patterns match project file types (js/​ts/​vue, optionally jsx/​tsx/​css/​scss)
  6. ✓ Commands use current CLI flags (not deprecated)
  7. ✓ If Stylelint in project, style files have stylelint command

If Validation Fails

DO NOT PROCEED to the next skill. Create or fix the missing/​incorrect file immediately.

Notes

  • ESLint Auto-Fix: Runs eslint --fix on JS/​TS/​Vue files (verify flag current)
  • Prettier Formatting: Runs prettier --write on code and config files (verify flag current)
  • Fast and Efficient: Only processes staged files, not entire codebase
  • Husky Integration: Works with pre-commit hook for automated quality checks
  • Prevents Bad Commits: Blocks commits that don't meet linting standards
  • Sequential Execution: Commands in array run sequentially for each file
  • File Patterns: Supports glob patterns (*.{js,ts,vue}, *.{css,scss})
  • Extended Patterns: Include jsx/​tsx if React, css/​scss if using style files
  • Stylelint Optional: Only include if project has stylelint in package.json
  • Always verify current CLI flags - Tools may change flag syntax
  • JSON Format Preferred: Simple, declarative, works without build step
  • Command Arrays: Multiple commands per pattern run sequentially on same files

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View