Easy Setup Linting
Streamline your workflow with this configure, comprehensive, code, linting. Includes structured workflows, validation checks, and reusable patterns for setup.
Easy Setup Linting
Configure comprehensive code linting with ESLint, Prettier, Pylint, MyPy, or language-specific linters including IDE integration, pre-commit hooks, and CI quality gates.
When to Use This Command
Run this command when...
- You are setting up a new project and need ESLint, Prettier, and TypeScript linting configured with sensible defaults
- You want to add pre-commit hooks that enforce code quality checks before every commit
- You need to configure linting for Python (Flake8, Pylint, MyPy) or Rust (Clippy) projects
- You want IDE integration with real-time error highlighting and auto-fix-on-save for VS Code or JetBrains
- You need CI pipeline integration that blocks pull requests when linting violations are found
Quick Start
# .claude/commands/easy-setup-linting.yaml name: Easy Setup Linting description: Configure code linting with IDE integration and CI gates inputs: - name: language description: "Target language: javascript, typescript, python, rust" default: "auto"
# Auto-detect language and setup linting claude "easy-setup-linting" # Setup TypeScript linting with Prettier claude "easy-setup-linting --language typescript" # Setup Python linting with type checking claude "easy-setup-linting --language python --type-check"
Output:
[detect] Language: TypeScript + React
[install] eslint, prettier, @typescript-eslint/*, eslint-config-prettier
[config] Created .eslintrc.json (122 rules configured)
[config] Created .prettierrc (consistent formatting)
[config] Created .vscode/settings.json (format on save)
[hooks] Installed husky + lint-staged (pre-commit)
[ci] Added lint step to .github/workflows/ci.yml
Done. Linting active: editor, pre-commit, and CI.
Core Concepts
| Concept | Description |
|---|---|
| Language Detection | Auto-detects the primary language from file extensions and package manifests |
| Rule Configuration | Sensible default rules for code style, error prevention, best practices, and security patterns |
| IDE Integration | VS Code and JetBrains settings for real-time linting, auto-fix on save, and format on save |
| Pre-Commit Hooks | Husky + lint-staged (JS/TS) or pre-commit framework (Python) to check files before committing |
| CI Quality Gates | Pipeline steps that fail the build when linting violations are detected in pull requests |
Linting Enforcement Layers:
┌─────────────────────────────────────────┐
│ Code Quality Stack │
├─────────────┬─────────────┬─────────────┤
│ Layer 1 │ Layer 2 │ Layer 3 │
│ Editor │ Pre-Commit │ CI/CD │
│ │ │ │
│ Real-time │ On commit │ On PR │
│ Auto-fix │ Staged only │ Full check │
│ Format save │ Fast check │ Block merge │
└─────────────┴─────────────┴─────────────┘
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
language | string | "auto" | Target language: javascript, typescript, python, rust, or auto-detect |
type_check | boolean | false | Enable type checking (TypeScript strict mode or MyPy for Python) |
formatter | string | "prettier" | Code formatter: prettier (JS/TS), black (Python), or rustfmt (Rust) |
hooks | boolean | true | Install pre-commit hooks for staged file linting |
strict | boolean | false | Use strict rule set with zero tolerance for warnings |
Best Practices
- Set up linting at project creation -- Adding linting to an existing codebase produces hundreds of errors. Starting clean means every file passes from the first commit.
- Separate linting from formatting -- Use ESLint for logic rules and Prettier for formatting. This avoids rule conflicts and lets each tool do what it does best.
- Lint only staged files in pre-commit -- Using lint-staged runs the linter only on files being committed, keeping the pre-commit hook fast even in large codebases.
- Enable auto-fix on save -- Configure your editor to fix auto-fixable violations on every save. This eliminates most linting errors before they reach the commit hook.
- Gradually increase strictness -- Start with recommended rules, then enable stricter rules one at a time. This prevents overwhelming the team with hundreds of violations.
Common Issues
- ESLint and Prettier conflicts -- Both tools may try to enforce conflicting formatting rules. Install
eslint-config-prettierto disable ESLint formatting rules that conflict with Prettier. - Pre-commit hook too slow -- Running the full linter on every commit can take 10+ seconds. Ensure lint-staged is configured to lint only staged files, not the entire project.
- Editor not showing lint errors -- The IDE extension needs the same ESLint version and config that the project uses. Run
npm installand restart the editor to refresh the linting configuration.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.