SuperAPI AI 工具集

ln-741-linter-configurator

通用与其它

查看项目

更新于 10-16 06:23

技能介绍

用途:该技能用于为项目自动配置代码检查(lint)、格式化与类型检查工具,覆盖 TypeScript、Python 和 .NET 三种技术栈。

主要能力:识别项目所属技术栈并检测现有配置;若配置缺失或不全,则基于模板生成或补全配置文件;安装依赖(始终安装最新版本,不锁定版本);生成统一检查脚本 scripts/lint.sh;验证各工具能否无错误运行。不负责配置 pre-commit 钩子、测试基础设施,也不修改源代码。

支持栈与工具:TypeScript 使用 ESLint 9+(flat config,eslint.config.ts)与 Prettier,类型检查用 tsc;.NET 使用 Roslyn Analyzers 和 dotnet format,配置文件为 .editorconfig、Directory.Build.props;Python 使用 Ruff(内置格式化)与 mypy,配置文件为 ruff.toml 与 mypy.toml(或 pyproject.toml)。

使用方式:先检查已有配置,再按栈复制对应模板并适配占位符,例如 TypeScript 复制 eslint_template.ts 与 prettier_template.json,并在 package.json 添加 lint、format、typecheck 等脚本;Python 复制 ruff_template.toml 与 mypy_template.toml,并按需合并到 pyproject.toml;随后安装依赖,如 npm install -D eslint @eslint/js typescript-eslint eslint-config-prettier prettier eslint-plugin-unicorn jiti,或 uv add --dev ruff mypy import-linter deptry vulture pip-audit。最后复制 lint_script_template.sh 为 scripts/lint.sh、chmod +x scripts/lint.sh,并用 bash scripts/lint.sh 验证;失败时逐项修复,可用 --fix 自动修复。

适用场景:为新建或既有项目快速搭建统一 lint/format/typecheck 流程,尤其适合需要跨多技术栈标准化检查的项目。

限制:不配置 pre-commit、不搭测试、不改源码;Python 高级静态分析工具(import-linter、deptry、vulture、pip-audit)为强制项。资料未提供收费、价格与平台信息。