E

Easy Setup Linting

Streamline your workflow with this configure, comprehensive, code, linting. Includes structured workflows, validation checks, and reusable patterns for setup.

CommandClipticssetupv1.0.0MIT
0 views0 copies

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

ConceptDescription
Language DetectionAuto-detects the primary language from file extensions and package manifests
Rule ConfigurationSensible default rules for code style, error prevention, best practices, and security patterns
IDE IntegrationVS Code and JetBrains settings for real-time linting, auto-fix on save, and format on save
Pre-Commit HooksHusky + lint-staged (JS/TS) or pre-commit framework (Python) to check files before committing
CI Quality GatesPipeline 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

ParameterTypeDefaultDescription
languagestring"auto"Target language: javascript, typescript, python, rust, or auto-detect
type_checkbooleanfalseEnable type checking (TypeScript strict mode or MyPy for Python)
formatterstring"prettier"Code formatter: prettier (JS/TS), black (Python), or rustfmt (Rust)
hooksbooleantrueInstall pre-commit hooks for staged file linting
strictbooleanfalseUse strict rule set with zero tolerance for warnings

Best Practices

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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

  1. ESLint and Prettier conflicts -- Both tools may try to enforce conflicting formatting rules. Install eslint-config-prettier to disable ESLint formatting rules that conflict with Prettier.
  2. 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.
  3. Editor not showing lint errors -- The IDE extension needs the same ESLint version and config that the project uses. Run npm install and restart the editor to refresh the linting configuration.
Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates