ln-741-linter-configurator
Configures ESLint, Prettier, Ruff, mypy, and .NET analyzers
- License 许可
- MIT
- 最近更新
- 2026-05-02
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- ln-741-linter-configurator
- license
- MIT
- description
- Configures ESLint, Prettier, Ruff, mypy, and .NET analyzers
02 资源文件 10
- 参考文档references/directory_build_props_template.xml1.4 KB
- 参考文档references/editorconfig_template.ini4.1 KB
- 脚本references/eslint_template.ts3.6 KB
- 参考文档references/lifecycle-paths.md11.2 KB
- 脚本references/lint_script_template.sh3.8 KB
- 参考文档references/linter_guide.md9.8 KB
- 参考文档references/mypy_template.toml1.1 KB
- 参考文档references/prettier_template.json201 B
- 参考文档references/ruff_template.toml3.0 KB
- 参考文档references/state-detection.md4.4 KB
03 SKILL.md 正文
Paths: File paths (
shared/,references/,../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.
ln-741-linter-configurator
Type: L3 Worker Category: 7XX Project Bootstrap Parent: ln-740-quality-setup
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 (ln-742 does this)
- Set up test infrastructure (ln-743 does this)
- Modify source code
Supported Stacks
| Technology | Linter | Type Checker | Formatter | Config Files |
|---|---|---|---|---|
| TypeScript | ESLint 9+ (flat config) | TypeScript (tsc) | Prettier | eslint.config.ts, .prettierrc |
| .NET | Roslyn Analyzers | Roslyn | dotnet format | .editorconfig, Directory.Build.props |
| Python | Ruff | mypy | Ruff (built-in) | ruff.toml, mypy.toml (or pyproject.toml) |
Phase 1: Check Existing Configuration
Before generating configs, check what already exists.
Files to Check:
| Stack | Config Files | Glob Pattern |
|---|---|---|
| TypeScript | ESLint config | eslint.config.*, .eslintrc* |
| TypeScript | Prettier config | .prettierrc*, prettier.config.* |
| .NET | Editor config | .editorconfig |
| .NET | Build props | Directory.Build.props |
| Python | Ruff config | ruff.toml, pyproject.toml |
| Python | mypy config | mypy.toml, mypy.ini, pyproject.toml [tool.mypy] |
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:
- Copy
eslint_template.tsto project root aseslint.config.ts - Copy
prettier_template.jsonas.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
editorconfig_template.inias.editorconfig - Copy
directory_build_props_template.xmlasDirectory.Build.props - Ensure analyzers are included (SDK 5+ includes them by default)
Python:
- Copy
ruff_template.tomlasruff.toml- OR merge into existing
pyproject.tomlunder[tool.ruff]
- OR merge into existing
- Copy
mypy_template.tomlasmypy.toml- OR merge into existing
pyproject.tomlunder[tool.mypy]
- OR merge into existing
- Update
known-first-partyin isort config to match project package name - Update
filesin mypy config to match project source directories
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
eslint.config.tson Node.js < 22.10. On Node.js 22.10+ TypeScript configs are supported natively.
.NET:
- Analyzers included in SDK 5+ — no separate install needed
Python:
uv add --dev ruff mypy
# OR without uv:
pip install ruff mypy
Phase 4: Generate Lint Script
Generate scripts/lint.sh from lint_script_template.sh with checks for the detected stack.
- Copy
lint_script_template.shtoscripts/lint.sh - Uncomment the check lines matching the detected stack (Python/TypeScript/.NET)
- Set
TOTALvariable to match the number of active checks - Make file executable:
chmod +x scripts/lint.sh - For TypeScript: ensure
"lint:all"script exists inpackage.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: Optional Advanced Tools
Suggest but do not auto-install. Inform user and add as commented lines in scripts/lint.sh.
| Stack | Tool | Purpose | Install |
|---|---|---|---|
| TypeScript | dependency-cruiser | Architecture boundary validation | npm install -D dependency-cruiser |
| TypeScript | knip | Unused code/dependency detection | npm install -D knip |
| Python | vulture / deadcode | Dead code detection | uv add --dev vulture |
| Python | import-linter | Circular import prevention | uv add --dev import-linter |
| Python | deptry | Unused/missing dependency detection | uv add --dev deptry |
| .NET | CSharpier | Opinionated formatter (Prettier for C#) | dotnet tool install csharpier |
Critical Rules
RULE 1: Always include
eslint-config-prettier(last in config) when using ESLint + Prettier together.
RULE 2: Use ESLint flat config format (
eslint.config.ts), 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.
RULE 5: Always run mypy alongside Ruff for Python projects. Ruff handles style/bugs, mypy handles type safety.
RULE 6: Use
recommendedTypeCheckedas ESLint default, not justrecommended. Downgrade individual rules if needed.
RULE 7: Never pin dependency versions in install commands — always install latest.
Definition of Done
- [ ] Appropriate config files created for detected stack
- [ ] Dependencies installed (latest versions)
- [ ]
scripts/lint.shgenerated with correct checks for stack - [ ] 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)
- [ ] User informed of available lint/format commands and optional advanced tools
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 |
| 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 allowDefaultProject list |
ESLint .ts config fails |
Missing jiti | npm install -D jiti |
| TypeScript parse errors | Parser version mismatch | Align typescript-eslint with TS version |
| mypy missing stubs | Third-party library without types | Add [[mypy.overrides]] with ignore_missing_imports |
| mypy strict too strict | Hundreds of errors on first run | Start with relaxed config, enable strict gradually |
| Ruff not found | Not installed | pip install ruff or uv add ruff |
| dotnet format fails | Missing SDK | Install .NET SDK |
Version: 3.0.0 Last Updated: 2026-02-26
04 同仓库更多 Skills
zarr-python
Chunked N-D arrays for cloud storage. Compressed arrays, parallel I/O, S3/GCS integration, NumPy/Dask/Xarray compatible, for large-scale scientific computing pipelines.
zabbix
Zabbix monitoring system automation via API and Python. Use when: (1) Managing hosts, templates, items, triggers, or host groups, (2) Automating monitoring configuration, (3) Sending data via Zabbix trapper/sender, (4) Querying historical data or events, (5) Bulk operations on Zabbix objects, (6) Maintenance window management, (7) User/permission management
x-twitter-growth
X/Twitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X/Twitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.
what-if-oracle
Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like "what if...", "what would happen if...", "what are the possibilities", "explore scenarios", "scenario analysis", "possibility space", "what could go wrong", "best case / worst case", "risk analysis", "contingency planning", "strategic options", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.
vercel-react-best-practices
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
venue-templates
Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.