ln-741-linter-configurator by levnikolaevich/claude-code-skills
npx skills add https://github.com/levnikolaevich/claude-code-skills --skill ln-741-linter-configurator路径说明: 文件路径(
shared/、references/、../ln-*)是相对于技能仓库根目录的。如果在当前工作目录中未找到,请定位此 SKILL.md 文件所在的目录,然后向上返回一级以找到仓库根目录。如果缺少shared/目录,请通过 WebFetch 从https://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}获取文件。
类型: L3 Worker 类别: 7XX 项目引导
为 TypeScript、Python 和 .NET 项目配置代码检查、格式化和类型检查工具。
执行的操作:
scripts/lint.sh)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
不执行的操作:
| 技术 | 检查工具 | 类型检查器 | 格式化工具 | 配置文件 |
|---|---|---|---|---|
| TypeScript | ESLint 9+ (扁平配置) | TypeScript (tsc) | Prettier | eslint.config.ts, .prettierrc |
| .NET | Roslyn Analyzers | Roslyn | dotnet format | .editorconfig, Directory.Build.props |
| Python | Ruff | mypy | Ruff (内置) | ruff.toml, mypy.toml (或 pyproject.toml) |
在生成配置之前,先检查已存在的内容。
需要检查的文件:
| 栈 | 配置文件 | Glob 模式 |
|---|---|---|
| TypeScript | ESLint 配置 | eslint.config.*, .eslintrc* |
| TypeScript | Prettier 配置 | .prettierrc*, prettier.config.* |
| .NET | Editor 配置 | .editorconfig |
| .NET | Build 属性 | Directory.Build.props |
| Python | Ruff 配置 | ruff.toml, pyproject.toml |
| Python | mypy 配置 | mypy.toml, mypy.ini, pyproject.toml [tool.mypy] |
决策逻辑:
完整性检查(Python):
| 方面 | 检查项 | 模板标准 |
|---|---|---|
| Ruff 规则 | 统计 select 条目数量 | 23+ 个类别(参见 ruff_template.toml) |
| Ruff 按文件忽略 | 存在测试部分 | tests/**/*.py 附带 S101,S105,S106,T201 |
| Ruff 高级功能 | mccabe, flake8-bugbear, isort | 全部存在 |
| MyPy | strict = true | 已启用 |
| 高级工具 | dev 依赖中包含 import-linter, deptry, vulture | 全部已安装 |
| 检查脚本 | scripts/lint.sh 包含 7 项检查 | 全部 7 项激活 |
| .editorconfig | 文件存在 | 存在 |
使用 references/ 文件夹中的模板。根据项目自定义占位符。
TypeScript:
eslint_template.ts 复制到项目根目录,命名为 eslint.config.tsprettier_template.json 复制为 .prettierrcpackage.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".NET:
editorconfig_template.ini 复制为 .editorconfigdirectory_build_props_template.xml 复制为 Directory.Build.propsPython:
ruff_template.toml 复制为 ruff.toml
pyproject.toml 的 [tool.ruff] 部分下mypy_template.toml 复制为 mypy.toml
pyproject.toml 的 [tool.mypy] 部分下known-first-party 以匹配项目包名files 以匹配项目源代码目录pyproject.toml 中生成高级工具配置:
[tool.importlinter] 来自 importlinter_template.toml -- 根据项目层级结构调整 root_packages 和 contracts[tool.vulture] 来自 vulture_template.toml -- 根据项目源代码目录调整 paths[tool.deptry] 来自 deptry_template.toml -- 调整 extend_excludeeditorconfig_template.ini 生成 .editorconfig -- 调整 max_line_length 以匹配 ruff 的 line-length安装所需的包。始终安装最新版本 — 不固定版本。
TypeScript:
npm install -D eslint @eslint/js typescript-eslint eslint-config-prettier prettier eslint-plugin-unicorn jiti
对于 React 项目,还需安装:
npm install -D eslint-plugin-react eslint-plugin-react-hooks
关于 jiti 的说明: 在 Node.js < 22.10 上运行
eslint.config.ts需要此包。在 Node.js 22.10+ 上原生支持 TypeScript 配置。
.NET:
Python:
uv add --dev ruff mypy import-linter deptry vulture pip-audit
# 或者不使用 uv:
pip install ruff mypy import-linter deptry vulture pip-audit
根据检测到的栈,从 lint_script_template.sh 生成包含所有检查项的 scripts/lint.sh。
lint_script_template.sh 复制到 scripts/lint.sh| 栈 | 检查项 | 总计 |
|---|---|---|
| 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 |
TOTAL 设置为活动检查项的数量--fix 块中取消注释匹配的自动修复命令chmod +x scripts/lint.shpackage.json 中存在 "lint:all" 脚本配置完成后,验证一切正常。
TypeScript:
npx tsc --noEmit
npx eslint .
npx prettier --check .
.NET:
dotnet format --verify-no-changes
Python:
ruff check .
ruff format --check .
mypy
统一验证:
bash scripts/lint.sh
预期结果:所有检查的退出代码均为 0。
如果失败: 检查错误输出,调整配置,重新验证。
生成所有配置并安装工具后,运行 bash scripts/lint.sh --all 查看所有违规项。
bash scripts/lint.sh --fix 以自动修复 ruff 能处理的部分# noqa: C901[tool.deptry.per_rule_ignores] 条目bash scripts/lint.sh 通过且失败数为 0规则 1: 当同时使用 ESLint 和 Prettier 时,始终包含
eslint-config-prettier(作为配置中的最后一项)。
规则 2: 使用 ESLint 扁平配置格式 (
eslint.config.ts),不要使用旧的.eslintrc。
规则 3: Ruff 替代了 Black、isort、flake8 和许多其他 Python 工具。不要单独安装它们。
规则 4: 没有文档记录的原因,绝不禁用严格的 TypeScript 规则。
规则 5: 对于 Python 项目,始终与 Ruff 一起运行 mypy。Ruff 处理样式/错误,mypy 处理类型安全。
规则 6: 使用
recommendedTypeChecked作为 ESLint 的默认配置,而不仅仅是recommended。如果需要,可以降级个别规则。
规则 7: 绝不在安装命令中固定依赖项版本 — 始终安装最新版本。
规则 8: 高级静态分析工具(import-linter、deptry、vulture、pip-audit)对于 Python 项目是强制性的,不是可选的。
scripts/lint.sh,其中包含针对该栈的正确检查项scripts/lint.sh 运行所有检查(Python 为 7 项)且退出代码为 0.editorconfig,其设置与 ruff 配置匹配| 文件 | 用途 |
|---|---|
| eslint_template.ts | ESLint 扁平配置模板 (TypeScript) |
| prettier_template.json | Prettier 配置模板 |
| ruff_template.toml | Python Ruff 配置模板 |
| mypy_template.toml | Python mypy 配置模板 |
| lint_script_template.sh | 统一检查脚本模板 |
| editorconfig_template.ini | .NET editorconfig 模板 |
| directory_build_props_template.xml | .NET 分析器模板 |
| importlinter_template.toml | Python import-linter 配置模板 |
| vulture_template.toml | Python vulture 配置模板 |
| deptry_template.toml | Python deptry 配置模板 |
| linter_guide.md | 详细配置指南 |
| 错误 | 原因 | 解决方案 |
|---|---|---|
| ESLint/Prettier 冲突 | 缺少 eslint-config-prettier | 安装并作为最后一项配置添加 |
| ESLint projectService 错误 | 配置文件不在 tsconfig 中 | 添加到 allowDefaultProject 列表 |
ESLint .ts 配置失败 | 缺少 jiti | npm install -D jiti |
| TypeScript 解析错误 | 解析器版本不匹配 | 将 typescript-eslint 与 TS 版本对齐 |
| mypy 缺少存根 | 第三方库没有类型定义 | 添加 [[mypy.overrides]] 并设置 ignore_missing_imports |
| mypy strict 过于严格 | 首次运行出现数百个错误 | 从宽松配置开始,逐步启用严格模式 |
| Ruff 未找到 | 未安装 | pip install ruff 或 uv add ruff |
| dotnet format 失败 | 缺少 SDK | 安装 .NET SDK |
版本: 4.0.0 最后更新: 2026-03-18
每周安装次数
152
仓库
GitHub 星标数
245
首次出现
2026年1月24日
安全审计
已安装于
claude-code139
opencode135
gemini-cli135
cursor135
codex134
github-copilot129
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. Ifshared/is missing, fetch files via WebFetch fromhttps://raw.githubusercontent.com/levnikolaevich/claude-code-skills/master/skills/{path}.
Type: L3 Worker Category: 7XX Project Bootstrap
Configures code linting, formatting, and type checking tools for TypeScript, Python, and .NET projects.
Does:
scripts/lint.sh)Does NOT:
| 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) | , (or ) |
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 |
Decision Logic:
Completeness Check (Python):
| Aspect | Check | Template Standard |
|---|---|---|
| Ruff rules | Count select entries | 23+ categories (see ruff_template.toml) |
| Ruff per-file-ignores | Tests section exists | tests/**/*.py with S101,S105,S106,T201 |
| Ruff advanced | mccabe, flake8-bugbear, isort | All present |
| MyPy | strict = true | Enabled |
| Advanced tools | import-linter, deptry, vulture in dev deps | All installed |
| Lint script |
Use templates from references/ folder. Customize placeholders based on project.
TypeScript:
eslint_template.ts to project root as eslint.config.tsprettier_template.json as .prettierrcpackage.json:
"lint": "eslint .""lint:fix": "eslint . --fix""format": "prettier --write .""format:check": "prettier --check .""typecheck": "tsc --noEmit".NET:
editorconfig_template.ini as .editorconfigdirectory_build_props_template.xml as Directory.Build.propsPython:
ruff_template.toml as ruff.toml
pyproject.toml under [tool.ruff]mypy_template.toml as mypy.toml
pyproject.toml under [tool.mypy]known-first-party in isort config to match project package namefiles in mypy config to match project source directoriesInstall 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:
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
Generate scripts/lint.sh from lint_script_template.sh with ALL checks for the detected stack.
lint_script_template.sh to scripts/lint.sh| 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 |
TOTAL to match active checks count--fix blockchmod +x scripts/lint.sh"lint:all" script exists in package.jsonAfter 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.
After generating all configs and installing tools, run bash scripts/lint.sh --all to see all violations.
bash scripts/lint.sh --fix to auto-fix what ruff can# noqa: C901[tool.deptry.per_rule_ignores] entriesbash scripts/lint.sh passes with 0 failuresRULE 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.
RULE 8: Advanced static analysis tools (import-linter, deptry, vulture, pip-audit) are MANDATORY for Python projects, not optional.
scripts/lint.sh generated with correct checks for stackscripts/lint.sh runs ALL checks (7 for Python) with exit code 0.editorconfig created with settings matching ruff config| 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 |
| 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 |
Version: 4.0.0 Last Updated: 2026-03-18
Weekly Installs
152
Repository
GitHub Stars
245
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
claude-code139
opencode135
gemini-cli135
cursor135
codex134
github-copilot129
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
36,300 周安装
微信自动化监控与消息处理指南:Windows wxauto 与 macOS Accessibility API 实战
249 周安装
OpenAI App迁移至MCP完整指南:SDK迁移、CSP配置与最佳实践
251 周安装
mgrep 代码语义搜索工具 - 智能探索大型代码库,支持自然语言查询代码/文本/PDF/图像
250 周安装
Vercel部署专家指南:Next.js应用环境变量、Edge函数与构建优化最佳实践
251 周安装
数据管道架构设计指南:ETL/ELT、Lambda、Kappa、Lakehouse架构与成本优化
257 周安装
规划代理 (planning-agent) - AI驱动的软件开发实施规划工具,2025年最佳实践
253 周安装
ruff.tomlmypy.tomlpyproject.toml| Python | Ruff config | ruff.toml, pyproject.toml |
| Python | mypy config | mypy.toml, mypy.ini, pyproject.toml [tool.mypy] |
scripts/lint.sh with 7 checks |
| All 7 active |
| .editorconfig | File exists | Present |
"lint:all": "npm run typecheck && npm run lint && npm run format:check"pyproject.toml:
[tool.importlinter] from importlinter_template.toml -- adapt root_packages and contracts to project layer structure[tool.vulture] from vulture_template.toml -- adapt paths to project source directory[tool.deptry] from deptry_template.toml -- adapt extend_exclude.editorconfig from editorconfig_template.ini -- adapt max_line_length to match ruff line-length| .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 |
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 |