代码检查配置

Universal

ln-741-linter-configurator

by levnikolaevich

自动识别 TypeScript、Python、.NET 项目栈,生成 ESLint、Prettier、Ruff、mypy 与 .NET analyzers 配置,安装依赖并统一 lint 脚本,适合项目初始化或补齐代码质量基建。

把 ESLint、Prettier、Ruff、mypy 和 .NET 分析器一次配齐,特别适合多技术栈团队快速统一代码规范与静态检查。

415编码与调试未扫描2026年3月5日

安装

claude skill add --url github.com/levnikolaevich/claude-code-skills/tree/master/ln-741-linter-configurator

文档

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

TechnologyLinterType CheckerFormatterConfig Files
TypeScriptESLint 9+ (flat config)TypeScript (tsc)Prettiereslint.config.ts, .prettierrc
.NETRoslyn AnalyzersRoslyndotnet format.editorconfig, Directory.Build.props
PythonRuffmypyRuff (built-in)ruff.toml, mypy.toml (or pyproject.toml)

Phase 1: Check Existing Configuration

Before generating configs, check what already exists.

Files to Check:

StackConfig FilesGlob Pattern
TypeScriptESLint configeslint.config.*, .eslintrc*
TypeScriptPrettier config.prettierrc*, prettier.config.*
.NETEditor config.editorconfig
.NETBuild propsDirectory.Build.props
PythonRuff configruff.toml, pyproject.toml
Pythonmypy configmypy.toml, mypy.ini, pyproject.toml [tool.mypy]

Decision Logic:

  1. If config exists and is complete: SKIP (inform user)
  2. If config exists but incomplete: ASK user to merge or replace
  3. If no config exists: CREATE from template

Phase 2: Generate Configuration

Use templates from references/ folder. Customize placeholders based on project.

TypeScript:

  1. Copy eslint_template.ts to project root as eslint.config.ts
  2. Copy prettier_template.json as .prettierrc
  3. 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"
  4. For React projects: uncomment React sections in template

.NET:

  1. Copy editorconfig_template.ini as .editorconfig
  2. Copy directory_build_props_template.xml as Directory.Build.props
  3. Ensure analyzers are included (SDK 5+ includes them by default)

Python:

  1. Copy ruff_template.toml as ruff.toml
    • OR merge into existing pyproject.toml under [tool.ruff]
  2. Copy mypy_template.toml as mypy.toml
    • OR merge into existing pyproject.toml under [tool.mypy]
  3. Update known-first-party in isort config to match project package name
  4. Update files in mypy config to match project source directories

Phase 3: Install Dependencies

Install required packages. Always install latest versions — no version pinning.

TypeScript:

code
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.ts on 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:

code
uv add --dev ruff mypy
code
# 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.

  1. Copy lint_script_template.sh to scripts/lint.sh
  2. Uncomment the check lines matching the detected stack (Python/TypeScript/.NET)
  3. Set TOTAL variable to match the number of active checks
  4. Make file executable: chmod +x scripts/lint.sh
  5. For TypeScript: ensure "lint:all" script exists in package.json

Phase 5: Verify Setup

After configuration, verify everything works.

TypeScript:

bash
npx tsc --noEmit
npx eslint .
npx prettier --check .

.NET:

bash
dotnet format --verify-no-changes

Python:

bash
ruff check .
ruff format --check .
mypy

Unified verification:

bash
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.

StackToolPurposeInstall
TypeScriptdependency-cruiserArchitecture boundary validationnpm install -D dependency-cruiser
TypeScriptknipUnused code/dependency detectionnpm install -D knip
Pythonvulture / deadcodeDead code detectionuv add --dev vulture
Pythonimport-linterCircular import preventionuv add --dev import-linter
PythondeptryUnused/missing dependency detectionuv add --dev deptry
.NETCSharpierOpinionated 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 recommendedTypeChecked as ESLint default, not just recommended. 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.sh generated 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

FilePurpose
eslint_template.tsESLint flat config template (TypeScript)
prettier_template.jsonPrettier config template
ruff_template.tomlPython Ruff config template
mypy_template.tomlPython mypy config template
lint_script_template.shUnified lint script template
editorconfig_template.ini.NET editorconfig template
directory_build_props_template.xml.NET analyzers template
linter_guide.mdDetailed configuration guide

Error Handling

ErrorCauseResolution
ESLint/Prettier conflictMissing eslint-config-prettierInstall and add as last config
ESLint projectService errorConfig file not in tsconfigAdd to allowDefaultProject list
ESLint .ts config failsMissing jitinpm install -D jiti
TypeScript parse errorsParser version mismatchAlign typescript-eslint with TS version
mypy missing stubsThird-party library without typesAdd [[mypy.overrides]] with ignore_missing_imports
mypy strict too strictHundreds of errors on first runStart with relaxed config, enable strict gradually
Ruff not foundNot installedpip install ruff or uv add ruff
dotnet format failsMissing SDKInstall .NET SDK

Version: 3.0.0 Last Updated: 2026-02-26

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描121.2k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描121.2k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描121.2k

相关 MCP 服务

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
84.2k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
53.3k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.4k

评论