ln-741-linter-configurator
Type: L3 Worker
Category: 7XX Project Bootstrap
Parent: ln-740-quality-setup
Configures code linting and formatting tools for TypeScript, .NET, and Python 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
- Verifies linter runs without errors
Does NOT:
- Configure pre-commit hooks (ln-742 does this)
- Set up test infrastructure (ln-743 does this)
- Modify source code
Supported Stacks
| Technology | Linter | Formatter | Config Files |
|---|
| TypeScript/React | ESLint 9+ (flat config) | Prettier | , |
| .NET | Roslyn Analyzers | dotnet format | , |
| Python | Ruff | 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 | , |
Decision Logic:
- If config exists and is complete: SKIP (inform user)
- If config exists but incomplete: ASK user to merge or replace
- If no config exists: CREATE from template
Phase 2: Generate Configuration
Use templates from references/ folder. Customize placeholders based on project.
TypeScript/React:
- Copy to project root as
- Copy as
- Add scripts to :
"lint:fix": "eslint . --fix"
"format": "prettier --write ."
"format:check": "prettier --check ."
.NET:
- Copy
editorconfig_template.ini
as
- Copy
directory_build_props_template.xml
as
- Ensure analyzers package reference included
Python:
- Copy as
- OR merge into existing under
- Add scripts to or document commands
Phase 3: Install Dependencies
Install required packages for each stack.
TypeScript/React:
npm install -D eslint @eslint/js typescript-eslint eslint-plugin-react eslint-plugin-react-hooks eslint-config-prettier prettier
CRITICAL: is REQUIRED to prevent ESLint/Prettier conflicts.
.NET:
- Analyzers configured via Directory.Build.props
- No separate install needed
Python:
pip install ruff
# OR with uv:
uv add --dev ruff
Phase 4: Verify Setup
After configuration, verify linter works.
TypeScript:
bash
npm run lint
npm run format:check
Expected: Exit code 0
.NET:
bash
dotnet format --verify-no-changes
Expected: Exit code 0
Python:
bash
ruff check .
ruff format --check .
Expected: Exit code 0
On Failure: Check error output, adjust config, re-verify.
Critical Rules
RULE 1: Always include
when using ESLint + Prettier together.
RULE 2: Use ESLint flat config format (eslint.config.mjs), NOT legacy .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.
Definition of Done
Reference Files
| File | Purpose |
|---|
| eslint_template.mjs | ESLint flat config template |
| prettier_template.json | Prettier config template |
| editorconfig_template.ini | .NET editorconfig template |
| directory_build_props_template.xml | .NET analyzers template |
| ruff_template.toml | Python Ruff config template |
| linter_guide.md | Detailed configuration guide |
Error Handling
| Error | Cause | Resolution |
|---|
| ESLint/Prettier conflict | Missing eslint-config-prettier | Install and add to config |
| TypeScript parse errors | Parser version mismatch | Align typescript-eslint with TS version |
| Ruff not found | Not installed | or |
| dotnet format fails | Missing SDK | Install .NET SDK |
Version: 2.0.0
Last Updated: 2026-01-10