Skip to main content

Overview

Runs linters with structured output grouped by rule and file. Auto-detects linter type and formats output for maximum token efficiency.

Syntax

Arguments

string
Linter name: eslint, ruff, pylint, mypy, or omit to auto-detect from first arg.
string[]
default:"."
Files or directories to lint. Defaults to current directory.

Supported Linters

JavaScript/TypeScript - ESLint

Features:
  • JSON output parsing
  • Grouped by rule
  • File-level summaries
  • Top 10 rules shown
Token savings: 84%

Python - Ruff

Features:
  • JSON output parsing
  • Grouped by rule code
  • File context preserved
  • Auto-detects ruff check subcommand
Token savings: 80%

Python - Pylint

Features:
  • JSON2 output format
  • Grouped by symbol (rule)
  • Message IDs shown (e.g., W0612)
  • Type breakdown (errors, warnings, conventions)
Token savings: 82%

Python - Mypy

Features:
  • Text output parsing
  • Grouped by file and error code
  • Context lines preserved
Token savings: 80%

Output Format

ESLint Example

Ruff Example

Pylint Example

Auto-Detection

RTK detects Python vs JavaScript linters: Python linters (installed via pip/pipx):
  • ruff, pylint, mypy, flake8
  • Invoked directly: Command::new("ruff")
JavaScript linters (installed via npm/pnpm):
  • eslint, biome
  • Invoked via package manager: npx eslint or pnpm exec eslint

Token Savings

Tee Output Recovery

On failure (linting errors found), full output is saved:
Read full details without re-running:

Exit Codes

Preserves linter exit codes:
  • 0 - No issues found
  • 1 - Linting errors found
  • 2 - Configuration or runtime error
  • rtk prettier - Format checker (70% savings)
  • rtk tsc - TypeScript compiler (83% savings)
  • rtk cargo clippy - Rust linter (80% savings)
  • rtk err - Generic error filter