Claude-code-skills ln-741-linter-configurator
Configures ESLint, Prettier, Ruff, mypy, and .NET analyzers. Use when setting up linting and formatting for a project.
git clone https://github.com/levnikolaevich/claude-code-skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/levnikolaevich/claude-code-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills-catalog/ln-741-linter-configurator" ~/.claude/skills/levnikolaevich-claude-code-skills-ln-741-linter-configurator && rm -rf "$T"
skills-catalog/ln-741-linter-configurator/SKILL.mdPaths: File paths (
,shared/,references/) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root. If../ln-*is missing, fetch files via WebFetch fromshared/.https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}
ln-741-linter-configurator
Type: L3 Worker Category: 7XX Project Bootstrap
Configures code linting, formatting, and type checking tools for TypeScript, Python, and .NET projects.
Purpose & Scope
Does:
- Detects which linter stack to configure based on project type
- Checks for existing linter configurations
- Generates appropriate config files from templates
- Installs required dependencies (always latest versions, no pinning)
- Generates unified lint script (
)scripts/lint.sh - Verifies all linters run without errors
Does NOT:
- Configure pre-commit hooks (separate worker)
- Set up test infrastructure (separate worker)
- Modify source code
Supported Stacks
| Technology | Linter | Type Checker | Formatter | Config Files |
|---|---|---|---|---|
| TypeScript | ESLint 9+ (flat config) | TypeScript (tsc) | Prettier | , |
| .NET | Roslyn Analyzers | Roslyn | dotnet format | , |
| Python | Ruff | mypy | Ruff (built-in) | , (or ) |
Phase 1: Check Existing Configuration
Before generating configs, check what already exists.
Files to Check:
| Stack | Config Files | Glob Pattern |
|---|---|---|
| TypeScript | ESLint config | , |
| TypeScript | Prettier config | , |
| .NET | Editor config | |
| .NET | Build props | |
| Python | Ruff config | , |
| Python | mypy config | , , |
Decision Logic:
- If no config exists: CREATE from template
- If config exists but incomplete (fewer rules/tools than template): EXTEND to match template
- If config matches template: SKIP (inform user)
Completeness Check (Python):
| Aspect | Check | Template Standard |
|---|---|---|
| Ruff rules | Count entries | 23+ categories (see ) |
| Ruff per-file-ignores | Tests section exists | with S101,S105,S106,T201 |
| Ruff advanced | mccabe, flake8-bugbear, isort | All present |
| MyPy | | Enabled |
| Advanced tools | import-linter, deptry, vulture in dev deps | All installed |
| Lint script | with 7 checks | All 7 active |
| .editorconfig | File exists | Present |
Phase 2: Generate Configuration
Use templates from references/ folder. Customize placeholders based on project.
TypeScript:
- Copy
to project root aseslint_template.tseslint.config.ts - Copy
asprettier_template.json.prettierrc - Add scripts to
:package.json"lint": "eslint .""lint:fix": "eslint . --fix""format": "prettier --write .""format:check": "prettier --check .""typecheck": "tsc --noEmit""lint:all": "npm run typecheck && npm run lint && npm run format:check"
- For React projects: uncomment React sections in template
.NET:
- Copy
aseditorconfig_template.ini.editorconfig - Copy
asdirectory_build_props_template.xmlDirectory.Build.props - Ensure analyzers are included (SDK 5+ includes them by default)
Python:
- Copy
asruff_template.tomlruff.toml- OR merge into existing
underpyproject.toml[tool.ruff]
- OR merge into existing
- Copy
asmypy_template.tomlmypy.toml- OR merge into existing
underpyproject.toml[tool.mypy]
- OR merge into existing
- Update
in isort config to match project package nameknown-first-party - Update
in mypy config to match project source directoriesfiles - Generate advanced tool configs in
:pyproject.toml
from[tool.importlinter]
-- adaptimportlinter_template.toml
and contracts to project layer structureroot_packages
from[tool.vulture]
-- adaptvulture_template.toml
to project source directorypaths
from[tool.deptry]
-- adaptdeptry_template.tomlextend_exclude
- Generate
from.editorconfig
-- adapteditorconfig_template.ini
to match ruffmax_line_lengthline-length
Phase 3: Install Dependencies
Install required packages. Always install latest versions — no version pinning.
TypeScript:
npm install -D eslint @eslint/js typescript-eslint eslint-config-prettier prettier eslint-plugin-unicorn jiti
For React projects, also install:
npm install -D eslint-plugin-react eslint-plugin-react-hooks
Note on jiti: Required for
on Node.js < 22.10. On Node.js 22.10+ TypeScript configs are supported natively.eslint.config.ts
.NET:
- Analyzers included in SDK 5+ — no separate install needed
Python:
uv add --dev ruff mypy import-linter deptry vulture pip-audit
# OR without uv: pip install ruff mypy import-linter deptry vulture pip-audit
Phase 4: Generate Lint Script
Generate
scripts/lint.sh from lint_script_template.sh with ALL checks for the detected stack.
- Copy
tolint_script_template.shscripts/lint.sh - Uncomment ALL check lines matching detected stack -- both basic AND advanced tools:
| Stack | Checks | TOTAL |
|---|---|---|
| Python | ruff check, ruff format, mypy, lint-imports, deptry, vulture, pip-audit | 7 |
| TypeScript | typecheck, eslint, prettier, knip, depcruise | 5 |
| .NET | dotnet build, dotnet format | 2 |
- Set
to match active checks countTOTAL - Uncomment matching auto-fix commands in
block--fix - Make executable:
chmod +x scripts/lint.sh - For TypeScript: ensure
script exists in"lint:all"package.json
Phase 5: Verify Setup
After configuration, verify everything works.
TypeScript:
npx tsc --noEmit npx eslint . npx prettier --check .
.NET:
dotnet format --verify-no-changes
Python:
ruff check . ruff format --check . mypy
Unified verification:
bash scripts/lint.sh
Expected: Exit code 0 for all checks.
On Failure: Check error output, adjust config, re-verify.
Phase 6: Fix Lint Errors
After generating all configs and installing tools, run
bash scripts/lint.sh --all to see all violations.
- Run
to auto-fix what ruff canbash scripts/lint.sh --fix - Fix remaining errors manually (file by file)
- For C901 (complexity) on functions that cannot be refactored now: add
# noqa: C901 - For deptry false positives: add
entries[tool.deptry.per_rule_ignores] - Repeat until
passes with 0 failuresbash scripts/lint.sh
Critical Rules
RULE 1: Always include
(last in config) when using ESLint + Prettier together.eslint-config-prettier
RULE 2: Use ESLint flat config format (
), NOT legacyeslint.config.ts..eslintrc
RULE 3: Ruff replaces Black, isort, flake8, and many other Python tools. Do NOT install them separately.
RULE 4: Never disable strict TypeScript rules without documented reason.
RULE 5: Always run mypy alongside Ruff for Python projects. Ruff handles style/bugs, mypy handles type safety.
RULE 6: Use
as ESLint default, not justrecommendedTypeChecked. Downgrade individual rules if needed.recommended
RULE 7: Never pin dependency versions in install commands -- always install latest.
RULE 8: Advanced static analysis tools (import-linter, deptry, vulture, pip-audit) are MANDATORY for Python projects, not optional.
Monitor (2.1.98+): When lint/typecheck verification commands expected >30s, use
Monitor. Fallback: Bash(run_in_background=true).
Definition of Done
- Appropriate config files created for detected stack
- Dependencies installed (latest versions)
-
generated with correct checks for stackscripts/lint.sh - Lint command runs without errors on project source
- Format command runs without errors
- Type checker runs without errors (mypy for Python, tsc for TypeScript)
- No ESLint/Prettier conflicts (eslint-config-prettier installed)
- Advanced tools installed and configured (import-linter, deptry, vulture, pip-audit)
-
runs ALL checks (7 for Python) with exit code 0scripts/lint.sh -
created with settings matching ruff config.editorconfig - User informed of available lint/format commands
Reference Files
| File | Purpose |
|---|---|
| eslint_template.ts | ESLint flat config template (TypeScript) |
| prettier_template.json | Prettier config template |
| ruff_template.toml | Python Ruff config template |
| mypy_template.toml | Python mypy config template |
| lint_script_template.sh | Unified lint script template |
| editorconfig_template.ini | .NET editorconfig template |
| directory_build_props_template.xml | .NET analyzers template |
| importlinter_template.toml | Python import-linter config template |
| vulture_template.toml | Python vulture config template |
| deptry_template.toml | Python deptry config template |
| linter_guide.md | Detailed configuration guide |
Error Handling
| Error | Cause | Resolution |
|---|---|---|
| ESLint/Prettier conflict | Missing eslint-config-prettier | Install and add as last config |
| ESLint projectService error | Config file not in tsconfig | Add to list |
ESLint config fails | Missing jiti | |
| TypeScript parse errors | Parser version mismatch | Align typescript-eslint with TS version |
| mypy missing stubs | Third-party library without types | Add with |
| mypy strict too strict | Hundreds of errors on first run | Start with relaxed config, enable strict gradually |
| Ruff not found | Not installed | or |
| dotnet format fails | Missing SDK | Install .NET SDK |
Version: 4.0.0 Last Updated: 2026-03-18