Skip to content
eslint-fix logo

ESLint 自动修复专家

eslint-fix

ESLint 自动修复专家 — 识别 ESLint 报错,批量修复,支持常见规则和自定义配置

SKILL.md

Full skill instructions

ESLint 自动修复专家

触发条件

当用户遇到 ESLint 错误或需要批量修复代码规范问题时激活此技能。

工作流程

  1. 检测项目配置

    • 查找 .eslintrc.* 或 eslint.config.* 文件
    • 识别使用的 ESLint 版本(v8/​v9)和插件
    • 检查是否有 prettier、@typescript-eslint 等扩展
  2. 运行 ESLint 检查

    • 执行 npx eslint . --format json 获取所有错误
    • 按文件和规则分组统计
    • 区分 warning 和 error
  3. 分类处理

    • 可自动修复(fixable):直接运行 eslint --fix
    • 需手动修复:逐条分析,提供修改建议
    • 需配置调整:建议禁用或调整规则
  4. 批量修复

    • 对可自动修复的文件批量执行修复
    • 对需要手动修改的文件,逐一展示 diff
    • 修复后再次运行 ESLint 验证

输出格式

## 📊 ESLint 检查报告

**项目:** [项目名]
**ESLint 版本:** v8/​v9
**总错误数:** X 个 error,Y 个 warning

### 📁 按文件统计
| 文件 | Error | Warning |
|------|-------|---------|
| src/​index.ts | 3 | 1 |
| src/​utils.ts | 0 | 2 |

## 🔧 修复结果

### ✅ 自动修复(X 个)
已修复文件:
- `src/​index.ts` — 修复了 3 个问题

### ⚠️ 需手动修复(Y 个)
#### `src/​utils.ts:15`
**规则:** `@typescript-eslint/​no-explicit-any`
**当前代码:**
\`\`\`typescript
function process(data: any) { ... }
\`\`\`
**建议修复:**
\`\`\`typescript
function process(data: unknown) { ... }
\`\`\`

## 💡 配置建议
- 建议在 `.eslintrc.js` 中添加以下规则以避免类似问题

常见可自动修复的规则

  • semi — 分号
  • quotes — 引号风格
  • indent — 缩进
  • no-trailing-spaces — 行尾空格
  • comma-dangle — 尾逗号
  • arrow-parements — 箭头函数括号
  • prefer-const — const vs let

注意事项

  • 修复前先确认用户的 ESLint 配置偏好
  • 对可能影响逻辑的修改要先询问用户
  • 修复后确保代码仍然可编译运行
  • 如果有 Prettier 配置,先运行 Prettier 再运行 ESLint

More Debugging skills

Evaluate ADK agents with metrics, evalsets, and the iterative eval-fix loop.

6K 472.7K
View

Postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.

2.7K 431.1K
View
skill-creator logo
Debugging

skill-creator

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

179.7K 399.2K
View

Ultra-compressed code review comments: location, problem, fix on one line each.

109.9K 388.8K
View

Structured debugging methodology that mandates root cause investigation before attempting any fixes.

295.4K 282.4K
View

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View

Comprehensive guide for Firebase Crashlytics, including provisioning and SDK usage. Use this skill when the user needs help setting up Crashlytics, adding crash reporting, or using the Crashlytics SDK in their application.

462 121.1K
View

Comprehensive reference guide for writing, debugging, and maintaining Playwright tests across all testing types and scenarios.

388 90.1K
View

Use for Vercel cost and performance optimization on deployed projects, especially Next.js, SvelteKit, Nuxt, and limited Astro apps. Collect Vercel metrics, usage, project config, and code scan results first; investigate only metric-backed candidates; produce ranked recommendations grounded in verified files and version-aware Vercel/framework docs. Trigger for Vercel bill reduction, slow or expensive routes, caching opportunities, Function Invocations, Build Minutes, Fast Data Transfer, Core Web Vitals, Bot Management, Fluid compute, or cost breakdown requests.

31.9K 89.6K
View

Comprehensive competitor analysis from URLs, combining site scraping with SEO and market data into structured profiles.

53.3K 83.8K
View
obsidian-cli logo
Debugging

obsidian-cli

Read, create, search, and manage Obsidian vault notes via CLI with built-in plugin development and debugging tools.

49.2K 77.7K
View
audit-website logo
Debugging

audit-website

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View