lint-sync
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLint Sync
Lint Sync
Purpose
用途
Two workflows in one skill:
- Migrate — Move ESLint/Prettier rules to Biome or Oxc with rule-by-rule comparison
- Modernize — Update existing Biome/Oxc configs: promote nursery rules, enable new quality flags, apply latest formatter options
本工具包含两种工作流:
- 迁移 — 将ESLint/Prettier规则逐步迁移至Biome或Oxc,并进行逐规则对比
- 现代化改造 — 更新现有Biome/Oxc配置:升级nursery规则、启用新的质量检测标识、应用最新格式化选项
When to Use This Skill
使用场景
Trigger phrases: "lint sync", "lint-sync", "eslint biome overlap", "biome migration", "oxlint migration", "migrate to oxc", "disable eslint rules", "modernize biome config", "update biome rules", "promote nursery rules", "update oxlint config"
触发关键词:"lint sync", "lint-sync", "eslint biome overlap", "biome migration", "oxlint migration", "migrate to oxc", "disable eslint rules", "modernize biome config", "update biome rules", "promote nursery rules", "update oxlint config"
Modes
模式
| Mode | Trigger | Description |
|---|---|---|
| sync | No mode or | Quick overlap check (migrate) or nursery/feature check (modernize). |
| audit | | Full analysis with performance data, coverage stats, migration/modernization checklist. |
| update | | Refresh mapping and version reference files from upstream sources. |
| 模式 | 触发方式 | 描述 |
|---|---|---|
| sync | 无模式或 | 快速重叠检查(迁移场景)或nursery/功能检查(现代化改造场景)。 |
| audit | | 完整分析,包含性能数据、覆盖率统计、迁移/现代化改造清单。 |
| update | | 从上游源刷新规则映射和版本参考文件。 |
Documentation
文档查询
Before fetching docs from the web, check for Context7 library IDs and direct URLs. This saves tokens significantly.
references/docs.mdContext7 IDs for quick lookups:
- Biome: (5357 snippets)
/biomejs/website - Oxc: (5057 snippets)
/oxc-project/website - Vite+: (210 snippets)
/websites/viteplus_dev
从网络获取文档前,请先查看中的Context7库ID和直接URL,可大幅节省令牌消耗。
references/docs.md快速查询的Context7 ID:
- Biome: (5357个代码片段)
/biomejs/website - Oxc: (5057个代码片段)
/oxc-project/website - Vite+: (210个代码片段)
/websites/viteplus_dev
Asking the User
用户询问规范
Every question in this skill is written as options. Use that tool where
the host offers it, or the host's nearest structured-choice equivalent. Where the host has
neither, ask the same question in normal chat as a numbered list of 2–5 options —
recommended first, one short line of description each — and wait for the user to reply
with a number.
AskUserQuestion本工具中的所有问题均以选项形式编写。若宿主平台提供该工具则直接使用,或使用平台最接近的结构化选择功能。若两者均无,则以普通聊天形式列出2-5个带编号的选项(推荐选项优先,每个选项配简短描述),等待用户回复编号。
AskUserQuestionWorkflow
工作流
Step 1: Detect All Configs
步骤1:检测所有配置文件
Find all relevant configuration files:
bash
undefined查找所有相关配置文件:
bash
undefinedSource tools (ESLint / Prettier)
源工具(ESLint / Prettier)
fd -t f '(eslint.config.(js|ts|mjs|cjs)|.eslintrc..*)' --max-depth 2
fd -t f '(.prettierrc(.(js|cjs|mjs|json|yaml|yml|toml))?|prettier.config.(js|cjs|mjs|ts))' --max-depth 2
fd -t f '(eslint.config.(js|ts|mjs|cjs)|.eslintrc..*)' --max-depth 2
fd -t f '(.prettierrc(.(js|cjs|mjs|json|yaml|yml|toml))?|prettier.config.(js|cjs|mjs|ts))' --max-depth 2
Target tools (Biome / Oxc)
目标工具(Biome / Oxc)
fd -t f 'biome.json(c)?$' --max-depth 2
fd -t f '(.oxlintrc.(json|jsonc)|oxlint.config.(ts|js))' --max-depth 2
fd -t f '(.oxfmtrc.(json|jsonc)|oxfmt.config.(ts|js))' --max-depth 2
fd -t f 'biome.json(c)?$' --max-depth 2
fd -t f '(.oxlintrc.(json|jsonc)|oxlint.config.(ts|js))' --max-depth 2
fd -t f '(.oxfmtrc.(json|jsonc)|oxfmt.config.(ts|js))' --max-depth 2
Vite+ (unified Oxc config)
Vite+(统一Oxc配置)
fd -t f 'vite.config.(ts|js|mjs)$' --max-depth 2
**Vite+ detection:** If `vite.config.ts` exists, check if it imports from `'vite-plus'`. Also check `package.json` for `vite-plus` in dependencies. If Vite+ is in use, its `lint` and `fmt` blocks in `vite.config.ts` **replace** standalone `.oxlintrc.json` and `.oxfmtrc.json`. Set `$VITEPLUS=true` and treat Oxc config as found.
```bashfd -t f 'vite.config.(ts|js|mjs)$' --max-depth 2
**Vite+检测:** 若存在`vite.config.ts`,检查是否从`'vite-plus'`导入。同时检查`package.json`的依赖中是否包含`vite-plus`。若使用Vite+,则`vite.config.ts`中的`lint`和`fmt`区块**替代**独立的`.oxlintrc.json`和`.oxfmtrc.json`。设置`$VITEPLUS=true`并视为已找到Oxc配置。
```bashQuick Vite+ detection
快速检测Vite+
grep -l "from ['"]vite-plus['"]" vite.config.ts 2>/dev/null
undefinedgrep -l "from ['"]vite-plus['"]" vite.config.ts 2>/dev/null
undefinedStep 2: Determine Workflow
步骤2:确定工作流类型
| ESLint/Prettier | Biome | Oxc/Vite+ | Workflow |
|---|---|---|---|
| Found | Found | - | Migrate to Biome |
| Found | - | Found | Migrate to Oxc |
| Found | Found | Found | Ask user which target |
| Found | - | - | Ask user which target to migrate to |
| - | Found | - | Modernize Biome |
| - | - | Found | Modernize Oxc |
| - | Found | Found | Modernize both (ask which first) |
| - | - | - | Nothing to do — inform user |
Vite+ counts as Oxc in the table above. When , all Oxc config reads/writes target the and blocks in instead of standalone config files.
$VITEPLUS=truelintfmtvite.config.tsAsk the target choice per Asking the User:
Which tool would you like to migrate to?
1. Biome (Recommended) — All-in-one linter + formatter, single config file
2. Oxc (Oxlint + Oxfmt) — Separate linter and formatter, ESLint-compatible rule names
3. Skip — Don't migrate, just show the analysis| 存在ESLint/Prettier | 存在Biome | 存在Oxc/Vite+ | 工作流类型 |
|---|---|---|---|
| 是 | 是 | 否 | 迁移至Biome |
| 是 | 否 | 是 | 迁移至Oxc |
| 是 | 是 | 是 | 询问用户选择目标工具 |
| 是 | 否 | 否 | 询问用户选择迁移目标 |
| 否 | 是 | 否 | 现代化改造Biome |
| 否 | 否 | 是 | 现代化改造Oxc |
| 否 | 是 | 是 | 现代化改造两者(询问优先顺序) |
| 否 | 否 | 否 | 无操作 — 告知用户 |
Vite+在表格中视为Oxc。当时,所有Oxc配置的读写操作均针对中的和区块,而非独立配置文件。
$VITEPLUS=truevite.config.tslintfmt按照用户询问规范发起目标选择请求:
您希望迁移至哪个工具?
1. Biome(推荐) — 一体化代码检查器+格式化工具,单一配置文件
2. Oxc(Oxlint + Oxfmt) — 分离式检查器与格式化工具,兼容ESLint规则命名
3. 跳过 — 不执行迁移,仅展示分析结果Migration Workflow
迁移工作流
Runs when ESLint/Prettier configs are present.
当存在ESLint/Prettier配置时启动。
M1: Get Tool Versions
M1:获取工具版本
bash
pnpm exec eslint --version 2>/dev/null || npx eslint --version 2>/dev/nullbash
pnpm exec eslint --version 2>/dev/null || npx eslint --version 2>/dev/nullTarget-specific
目标工具版本
pnpm exec biome --version 2>/dev/null || npx biome --version 2>/dev/null
pnpm exec biome --version 2>/dev/null || npx biome --version 2>/dev/null
or
或
pnpm exec oxlint --version 2>/dev/null || npx oxlint --version 2>/dev/null
pnpm exec oxfmt --version 2>/dev/null || npx oxfmt --version 2>/dev/null
Read the appropriate mapping and check version staleness:
- Biome: `references/biome-eslint-mapping.json` → `_meta.biomeVersion`
- Oxc: `references/oxc-eslint-mapping.json` → `_meta.oxlintVersion`
Compare installed version against `_meta` version. If installed is newer, warn that mappings may be stale and suggest running `update` mode.pnpm exec oxlint --version 2>/dev/null || npx oxlint --version 2>/dev/null
pnpm exec oxfmt --version 2>/dev/null || npx oxfmt --version 2>/dev/null
读取对应规则映射文件并检查版本是否过时:
- Biome: `references/biome-eslint-mapping.json` → `_meta.biomeVersion`
- Oxc: `references/oxc-eslint-mapping.json` → `_meta.oxlintVersion`
对比已安装版本与`_meta`中的版本。若已安装版本更新,需警告映射文件可能过时,并建议运行`update`模式。M2: Gather Active Rules
M2:收集激活规则
bash
bash scripts/get-eslint-rules.sh
bash scripts/get-biome-rules.sh # or get-oxlint-rules.shIf a script fails, fall back to reading configs manually.
bash
bash scripts/get-eslint-rules.sh
bash scripts/get-biome-rules.sh # 或 get-oxlint-rules.sh若脚本执行失败,则回退至手动读取配置文件。
M3: Load References
M3:加载参考文件
bash
cat references/biome-eslint-mapping.json # or oxc-eslint-mapping.json
cat references/type-aware-rules.jsonFor Oxc, also load .
references/oxc-defaults.jsonbash
cat references/biome-eslint-mapping.json # 或 oxc-eslint-mapping.json
cat references/type-aware-rules.json针对Oxc,还需加载。
references/oxc-defaults.jsonM4: Cross-Reference (Core Analysis)
M4:交叉引用(核心分析)
For each active ESLint rule, classify it:
| Category | Meaning | Action |
|---|---|---|
| DISABLE | Target has "same" equivalent AND it's active | Safe to turn off in ESLint |
| REVIEW | Target has "inspired" equivalent AND it's active | Check behavior before disabling |
| ENABLE_TARGET | Target has equivalent but it's NOT active | Can switch by enabling in target config |
| ESLINT_ONLY | No target equivalent exists | Must keep in ESLint |
| TYPE_AWARE | Requires TypeScript type info | Expensive; check if target supports it |
Biome classification:
for each active ESLint rule:
1. Look up in biome-eslint-mapping.json
- Resolution: exact → "eslint-plugin-" prefix → scoped (@scope/rule)
- Core ESLint rules match directly: "no-debugger"
2. No mapping → check type-aware-rules.json → TYPE_AWARE or ESLINT_ONLY
3. Mapping exists:
a. Check if Biome rule is active (match by RULE NAME only, not category)
b. Active + "same" → DISABLE
c. Active + "inspired" → REVIEW
d. Not active → ENABLE_TARGETOxc classification:
for each active ESLint rule:
1. Look up in oxc-eslint-mapping.json (same resolution order)
2. No mapping → TYPE_AWARE (if in type-aware list) or ESLINT_ONLY
- Oxlint supports type-aware rules via tsgolint (check "typeAware" field)
3. Mapping exists:
a. Check if active; all Oxlint mappings are "same" relationship
b. Active → DISABLE
c. Not active → ENABLE_TARGET对每个激活的ESLint规则进行分类:
| 分类 | 含义 | 操作 |
|---|---|---|
| DISABLE | 目标工具拥有“完全等效”规则且已激活 | 可安全关闭ESLint中的该规则 |
| REVIEW | 目标工具拥有“启发式等效”规则且已激活 | 关闭前需检查行为差异 |
| ENABLE_TARGET | 目标工具拥有等效规则但未激活 | 可通过在目标配置中启用该规则完成迁移 |
| ESLINT_ONLY | 目标工具无等效规则 | 必须保留在ESLint中 |
| TYPE_AWARE | 需要TypeScript类型信息 | 性能开销大;检查目标工具是否支持 |
Biome分类逻辑:
对每个激活的ESLint规则:
1. 在biome-eslint-mapping.json中查找
- 匹配顺序:精确匹配 → 移除"eslint-plugin-"前缀 → 作用域规则(@scope/rule)
- ESLint核心规则直接匹配:"no-debugger"
2. 无映射 → 检查type-aware-rules.json → 标记为TYPE_AWARE或ESLINT_ONLY
3. 存在映射:
a. 检查Biome规则是否激活(仅匹配规则名称,不匹配分类)
b. 已激活且为“完全等效” → DISABLE
c. 已激活且为“启发式等效” → REVIEW
d. 未激活 → ENABLE_TARGETOxc分类逻辑:
对每个激活的ESLint规则:
1. 在oxc-eslint-mapping.json中查找(匹配顺序同上)
2. 无映射 → 若在类型感知规则列表中则标记为TYPE_AWARE,否则为ESLINT_ONLY
- Oxlint通过tsgolint支持类型感知规则(检查"typeAware"字段)
3. 存在映射:
a. 检查是否激活;所有Oxc映射均为“完全等效”关系
b. 已激活 → DISABLE
c. 未激活 → ENABLE_TARGETM5: Prettier Migration Analysis
M5:Prettier迁移分析
If Prettier config found:
Biome: Map Prettier options → Biome equivalents (see table in ).
Note: automates this.
references/docs.mdbiome migrate prettier --writeOxc: Oxfmt uses Prettier-compatible option names. Key differences:
- defaults to
printWidth(Prettier:100)80 - not supported
endOfLine: "auto" - Built-in: ,
sortImports,sortTailwindcssNote:sortPackageJsonautomates this.oxfmt --migrate=prettier
Import sorting (both targets): Check if the project uses sort rules, , , or . If so, recommend enabling the native import sorter:
eslint-plugin-import@trivago/prettier-plugin-sort-importsprettier-plugin-organize-imports@ianvs/prettier-plugin-sort-imports- Biome: in
"organizeImports": { "enabled": true }biome.json - Oxfmt: (see defaults in
"sortImports": { ... })oxc-defaults.json
Tailwind class sorting (both targets): Check if is in project deps. If so, and if was in use, recommend enabling native sorting:
tailwindcssprettier-plugin-tailwindcss- Biome: not built-in — keep the Prettier plugin or use if available
biome-plugin-tailwindcss - Oxfmt: built-in (see
"sortTailwindcss": { ... }→oxc-defaults.json)oxfmt_ifTailwind
若检测到Prettier配置:
Biome: 将Prettier选项映射为Biome等效选项(详见中的表格)。
注意:可自动完成该操作。
references/docs.mdbiome migrate prettier --writeOxc: Oxfmt使用与Prettier兼容的选项名称。主要差异:
- 默认值为
printWidth(Prettier为100)80 - 不支持
endOfLine: "auto" - 内置功能:,
sortImports,sortTailwindcss注意:sortPackageJson可自动完成该操作。oxfmt --migrate=prettier
导入排序(两种目标工具): 检查项目是否使用排序规则、、或。若使用,建议启用原生导入排序功能:
eslint-plugin-import@trivago/prettier-plugin-sort-importsprettier-plugin-organize-imports@ianvs/prettier-plugin-sort-imports- Biome: 在中设置
biome.json"organizeImports": { "enabled": true } - Oxfmt: 设置(详见
"sortImports": { ... }中的默认配置)oxc-defaults.json
Tailwind类排序(两种目标工具): 检查项目依赖中是否包含。若包含且曾使用,建议启用原生排序功能:
tailwindcssprettier-plugin-tailwindcss- Biome: 无内置支持 — 保留Prettier插件或使用可用的
biome-plugin-tailwindcss - Oxfmt: 内置(详见
"sortTailwindcss": { ... }→oxc-defaults.json)oxfmt_ifTailwind
M6: Oxc Config Initialization (Oxc Only)
M6:Oxc配置初始化(仅Oxc场景)
If no Oxc config exists, offer to create from .
references/oxc-defaults.jsonBefore writing config, check project dependencies:
bash
undefined若不存在Oxc配置,可基于创建。
references/oxc-defaults.json写入配置前,检查项目依赖:
bash
undefinedCheck for React
检查是否包含React
jq -r '.dependencies.react // .devDependencies.react // empty' package.json
jq -r '.dependencies.react // .devDependencies.react // empty' package.json
Check for Tailwind CSS
检查是否包含Tailwind CSS
jq -r '.dependencies.tailwindcss // .devDependencies.tailwindcss // empty' package.json
**Config assembly from defaults:**
- Always: `categories`, `rules`, `env`, `options` from `oxlint` section
- Always: `plugins.always` (`eslint`, `typescript`, `unicorn`, `oxc`, `import`)
- If React in deps: add `plugins.ifReact` (`react`, `react-hooks`, `jsx-a11y`)
- Oxfmt: `singleQuote`, `sortImports` from `oxfmt` section
- If Tailwind in deps: merge `oxfmt_ifTailwind` → enables `sortTailwindcss` with class sorting for `className`, `class`, and common helpers (`clsx`, `cn`, `cva`, `tw`, `twMerge`, `twJoin`)
**Vite+ projects (`$VITEPLUS=true`):** Write into `vite.config.ts` `lint` and `fmt` blocks. Do NOT create standalone config files. Example:
```typescript
import { defineConfig } from 'vite-plus';
export default defineConfig({
lint: {
categories: { correctness: 'error', suspicious: 'warn', perf: 'warn' },
plugins: ['eslint', 'typescript', 'unicorn', 'oxc', 'import', 'react', 'react-hooks', 'jsx-a11y'],
rules: {
'no-console': 'warn',
'eqeqeq': 'error',
'import/no-cycle': 'error',
},
options: { typeAware: true, typeCheck: true },
},
fmt: {
singleQuote: true,
sortImports: { ignoreCase: true, order: 'asc', newlinesBetween: true },
sortTailwindcss: { functions: ['clsx', 'cn', 'cva', 'tw'] }, // if Tailwind
},
});Standalone Oxc projects: Write and .
.oxlintrc.json.oxfmtrc.jsonjq -r '.dependencies.tailwindcss // .devDependencies.tailwindcss // empty' package.json
**基于默认配置组装:**
- 必选:`categories`, `rules`, `env`, `options`来自`oxlint`区块
- 必选:`plugins.always`(`eslint`, `typescript`, `unicorn`, `oxc`, `import`)
- 若包含React依赖:添加`plugins.ifReact`(`react`, `react-hooks`, `jsx-a11y`)
- Oxfmt: `singleQuote`, `sortImports`来自`oxfmt`区块
- 若包含Tailwind依赖:合并`oxfmt_ifTailwind` → 启用`sortTailwindcss`,支持`className`, `class`及常用工具函数(`clsx`, `cn`, `cva`, `tw`, `twMerge`, `twJoin`)的类排序
**Vite+项目(`$VITEPLUS=true`):** 写入`vite.config.ts`的`lint`和`fmt`区块。请勿创建独立配置文件。示例:
```typescript
import { defineConfig } from 'vite-plus';
export default defineConfig({
lint: {
categories: { correctness: 'error', suspicious: 'warn', perf: 'warn' },
plugins: ['eslint', 'typescript', 'unicorn', 'oxc', 'import', 'react', 'react-hooks', 'jsx-a11y'],
rules: {
'no-console': 'warn',
'eqeqeq': 'error',
'import/no-cycle': 'error',
},
options: { typeAware: true, typeCheck: true },
},
fmt: {
singleQuote: true,
sortImports: { ignoreCase: true, order: 'asc', newlinesBetween: true },
sortTailwindcss: { functions: ['clsx', 'cn', 'cva', 'tw'] }, // 若使用Tailwind
},
});独立Oxc项目: 写入和。
.oxlintrc.json.oxfmtrc.jsonM7: Performance Analysis (Audit Mode Only)
M7:性能分析(仅Audit模式)
bash
TIMING=1 pnpm exec eslint 'src/**/*.{ts,tsx}' 2>&1 | tee "$SCRATCHPAD/eslint-timing.txt"Cross-reference slowest rules against mapping and type-aware list.
bash
TIMING=1 pnpm exec eslint 'src/**/*.{ts,tsx}' 2>&1 | tee "$SCRATCHPAD/eslint-timing.txt"将最慢的规则与映射文件和类型感知规则列表交叉对比。
M8: Generate Migration Report
M8:生成迁移报告
See Report Templates below.
详见下方报告模板。
Modernize Workflow
现代化改造工作流
Runs when no ESLint/Prettier configs exist but Biome and/or Oxc configs are present.
当不存在ESLint/Prettier配置但存在Biome和/或Oxc配置时启动。
N1: Read Current Config
N1:读取当前配置
Read and parse the tool's config file:
- Biome: or
biome.jsonbiome.jsonc - Oxc standalone: and
.oxlintrc.json.oxfmtrc.json - Vite+ (): parse
$VITEPLUS=trueandlintblocks fromfmtvite.config.ts
读取并解析工具的配置文件:
- Biome: 或
biome.jsonbiome.jsonc - 独立Oxc: 和
.oxlintrc.json.oxfmtrc.json - Vite+(): 解析
$VITEPLUS=true中的vite.config.ts和lint区块fmt
N2: Get Installed Version
N2:获取已安装版本
bash
pnpm exec biome --version 2>/dev/null || npx biome --version 2>/dev/nullbash
pnpm exec biome --version 2>/dev/null || npx biome --version 2>/dev/nullor
或
pnpm exec oxlint --version 2>/dev/null || npx oxlint --version 2>/dev/null
undefinedpnpm exec oxlint --version 2>/dev/null || npx oxlint --version 2>/dev/null
undefinedN3: Load Version History
N3:加载版本历史
bash
cat references/biome-versions.json # or oxc-versions.jsonDetermine which versions the user has passed through since their config was last updated. Use the installed version to find applicable changes.
bash
cat references/biome-versions.json # 或 oxc-versions.json确定用户自上次更新配置以来经历的版本。使用已安装版本查找适用的变更。
N4: Check Nursery Promotions (Biome)
N4:检查Nursery规则升级(Biome)
Scan the user's config for any rules referencing category. Cross-reference against → entries for the installed version and all prior tracked versions.
nursery/biome-versions.jsonpromotedFromNurseryFor each stale nursery reference found:
| Current (stale) | Should be | Promoted in |
|---|---|---|
| | v2.4 |
| | v2.3 |
Generate a ready-to-apply diff or config patch.
扫描用户配置中所有引用分类的规则。与中已安装版本及所有历史版本的条目交叉对比。
nursery/biome-versions.jsonpromotedFromNursery针对每个找到的过时nursery引用:
| 当前(过时)规则 | 应升级为 | 升级版本 |
|---|---|---|
| | v2.4 |
| | v2.3 |
生成可直接应用的差异或配置补丁。
N5: Suggest New Quality Rules
N5:推荐新质量规则
Biome: Check for in versions newer than user's mapping date. Highlight rules that are:
biome-versions.jsonnewRules- Promoted to stable (non-nursery) — safe to enable
- Commonly useful (e.g., ,
noUnusedExpressions,noImportCycles)noFloatingPromises - New formatter options (e.g., in v2.4)
trailingNewline
Oxc: Check for rules not yet in user's config. Suggest:
oxc-versions.jsonrecommendedConfig- Categories worth enabling (,
suspicious)perf - High-value rules from →
oxc-versions.jsonrecommendedConfig.rules - New features (type-aware linting, Vue support, config extends)
Biome: 检查中比用户映射日期更新的版本中的。重点推荐以下规则:
biome-versions.jsonnewRules- 已升级为稳定版(非nursery)— 可安全启用
- 常用实用规则(如,
noUnusedExpressions,noImportCycles)noFloatingPromises - 新格式化选项(如v2.4中的)
trailingNewline
Oxc: 检查中用户配置尚未包含的规则。推荐:
oxc-versions.jsonrecommendedConfig- 值得启用的分类(,
suspicious)perf - →
oxc-versions.json中的高价值规则recommendedConfig.rules - 新功能(类型感知检查、Vue支持、配置继承)
N6: Suggest New Formatter Options and Sorting
N6:推荐新格式化选项与排序功能
Check project dependencies first:
bash
jq -r '.dependencies.tailwindcss // .devDependencies.tailwindcss // empty' package.jsonBiome: Check for . Highlight useful additions:
biome-versions.jsonnewFormatterOptions- (v2.4)
formatter.trailingNewline - (v2.3)
formatter.lineEnding: "auto" - for array/object control
formatter.expand - if not already on — replaces import-sort plugins
organizeImports.enabled: true - Note: Biome does not have built-in Tailwind class sorting
Oxc/Vite+: Check if Oxfmt features are underutilized:
- (off by default, high value — replaces import-sort plugins)
sortImports - (if Tailwind in deps — replaces
sortTailwindcss)prettier-plugin-tailwindcss - formatting (off by default)
jsdoc - For Vite+: and
lint.options.typeAware(recommended on)lint.options.typeCheck
先检查项目依赖:
bash
jq -r '.dependencies.tailwindcss // .devDependencies.tailwindcss // empty' package.jsonBiome: 检查中的。重点推荐实用新增选项:
biome-versions.jsonnewFormatterOptions- (v2.4)
formatter.trailingNewline - (v2.3)
formatter.lineEnding: "auto" - 用于数组/对象格式控制
formatter.expand - 若未启用则推荐— 替代导入排序插件
organizeImports.enabled: true - 注意:Biome无内置Tailwind类排序功能
Oxc/Vite+: 检查Oxfmt功能是否未充分利用:
- (默认关闭,高价值 — 替代导入排序插件)
sortImports - (若包含Tailwind依赖 — 替代
sortTailwindcss)prettier-plugin-tailwindcss - 格式化(默认关闭)
jsdoc - 针对Vite+:推荐启用和
lint.options.typeAwarelint.options.typeCheck
N7: Generate Modernize Report
N7:生成现代化改造报告
markdown
undefinedmarkdown
undefinedModernize Report
现代化改造报告
Environment
环境信息
- Tool: Biome vX.x / Oxlint vX.x / Vite+ vX.x
- Config: biome.json / .oxlintrc.json / vite.config.ts (lint + fmt)
- Reference version: X.x (installed: Y.y)
- 工具:Biome vX.x / Oxlint vX.x / Vite+ vX.x
- 配置文件:biome.json / .oxlintrc.json / vite.config.ts(lint + fmt)
- 参考版本:X.x(已安装版本:Y.y)
Nursery Promotions (Biome)
Nursery规则升级(Biome)
X rules in your config still reference nursery/ but have been promoted:
| Current | Updated | Version |
|---|---|---|
| | v2.3 |
您的配置中有X条规则仍引用nursery/但已升级至稳定版:
| 当前规则 | 升级后规则 | 升级版本 |
|---|---|---|
| | v2.3 |
New Rules Available
可用新规则
These rules are stable and recommended but not in your config:
| Rule | Category | Description |
|---|---|---|
| suspicious | Detect circular imports |
以下规则已稳定且推荐启用,但尚未加入您的配置:
| 规则 | 分类 | 描述 |
|---|---|---|
| suspicious | 检测循环导入 |
New Formatter Options
新格式化选项
| Option | Value | Since |
|---|---|---|
| | v2.4 |
| 选项 | 推荐值 | 新增版本 |
|---|---|---|
| | v2.4 |
Ready-to-Apply Config Patch
可直接应用的配置补丁
(JSON diff to paste into config)
---(可粘贴到配置文件中的JSON差异)
---Update Workflow
更新工作流
Refreshes all reference files from upstream.
刷新所有参考文件至上游最新版本。
U1: Update biome-eslint-mapping.json
U1:更新biome-eslint-mapping.json
- Fetch
https://biomejs.dev/linter/rules-sources/ - Parse ESLint → Biome rule mappings
- Diff against existing, show added/removed
- Update and
_meta.biomeVersion_meta.updatedAt
- 获取
https://biomejs.dev/linter/rules-sources/ - 解析ESLint → Biome规则映射
- 与现有文件对比,展示新增/移除条目
- 更新和
_meta.biomeVersion_meta.updatedAt
U2: Update oxc-eslint-mapping.json
U2:更新oxc-eslint-mapping.json
- Fetch
https://oxc.rs/docs/guide/usage/linter/rules - Parse supported rules by plugin
- Diff against existing, show added/removed
- Update and
_meta.oxlintVersion_meta.updatedAt
- 获取
https://oxc.rs/docs/guide/usage/linter/rules - 解析各插件支持的规则
- 与现有文件对比,展示新增/移除条目
- 更新和
_meta.oxlintVersion_meta.updatedAt
U3: Update type-aware-rules.json
U3:更新type-aware-rules.json
bash
gh api repos/typescript-eslint/typescript-eslint/contents/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts --jq '.content' | base64 -dParse, diff, update .
_meta.updatedAtbash
gh api repos/typescript-eslint/typescript-eslint/contents/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts --jq '.content' | base64 -d解析、对比、更新。
_meta.updatedAtU4: Update version files
U4:更新版本文件
Check Biome and Oxc changelogs for new versions not yet tracked:
- Biome: — look for new
https://biomejs.dev/blog/postsbiome-vX-Y - Oxc: — look for new release posts
https://oxc.rs/blog/
For each new version found, add entry to or with:
biome-versions.jsonoxc-versions.json- Promoted rules
- New rules
- New formatter options
- New features
检查Biome和Oxc更新日志,添加尚未追踪的新版本:
- Biome: — 查找新的
https://biomejs.dev/blog/发布文章biome-vX-Y - Oxc: — 查找新的发布文章
https://oxc.rs/blog/
针对每个找到的新版本,向或添加条目,包含:
biome-versions.jsonoxc-versions.json- 升级的规则
- 新增规则
- 新增格式化选项
- 新增功能
Report Templates
报告模板
Sync Mode (Migration)
Sync模式(迁移)
markdown
undefinedmarkdown
undefinedLint Sync Report
Lint Sync迁移报告
Environment
环境信息
- ESLint: vX.x (flat/legacy config)
- Target: Biome vX.x / Oxlint vX.x + Oxfmt vX.x
- Mapping version: YYYY-MM-DD (current / stale)
- Prettier config: found / not found
- ESLint: vX.x(扁平/传统配置)
- 目标工具:Biome vX.x / Oxlint vX.x + Oxfmt vX.x
- 映射文件版本:YYYY-MM-DD(当前/过时)
- Prettier配置:存在/不存在
Summary
摘要
| Category | Count |
|---|---|
| DISABLE (safe to remove) | X |
| REVIEW (check before removing) | X |
| ENABLE_TARGET (can migrate) | X |
| ESLINT_ONLY (must keep) | X |
| TYPE_AWARE | X |
| 分类 | 数量 |
|---|---|
| DISABLE(可安全移除) | X |
| REVIEW(移除前需检查) | X |
| ENABLE_TARGET(可迁移) | X |
| ESLINT_ONLY(必须保留) | X |
| TYPE_AWARE(类型感知) | X |
DISABLE — Safe to Turn Off in ESLint
DISABLE — 可安全关闭的ESLint规则
| ESLint Rule | Target Equivalent |
|---|
| ESLint规则 | 目标工具等效规则 |
|---|
REVIEW — Check Before Disabling
REVIEW — 关闭前需检查的规则
| ESLint Rule | Target Equivalent | Notes |
|---|
| ESLint规则 | 目标工具等效规则 | 注意事项 |
|---|
ENABLE_TARGET — Available to Migrate
ENABLE_TARGET — 可迁移至目标工具的规则
| ESLint Rule | Target Equivalent | Relationship |
|---|
| ESLint规则 | 目标工具等效规则 | 等效关系 |
|---|
ESLINT_ONLY — Must Keep
ESLINT_ONLY — 必须保留的规则
| ESLint Rule | Type-Aware? |
|---|
| ESLint规则 | 是否为类型感知规则? |
|---|
Prettier Migration (if applicable)
Prettier迁移(若适用)
| Prettier Option | Current Value | Target Option | Target Default | Action |
|---|
| Prettier选项 | 当前值 | 目标工具选项 | 目标工具默认值 | 操作建议 |
|---|
Ready-to-Paste Config
可直接粘贴的配置
undefinedundefinedAudit Mode (adds to Sync)
Audit模式(在Sync模式基础上添加)
markdown
undefinedmarkdown
undefinedPerformance Analysis
性能分析
Top 10 Slowest Rules
最慢的10条规则
| Rule | Time (ms) | Type-Aware? | Target Equivalent? |
|---|
| 规则 | 耗时(毫秒) | 是否为类型感知规则? | 目标工具是否有等效规则? |
|---|
Coverage Statistics
覆盖率统计
- Total active ESLint rules: X
- Covered by target: X (Y%)
- ESLint-only: X (Y%)
- Type-aware: X (Y%)
- 激活的ESLint规则总数:X
- 目标工具覆盖规则数:X(Y%)
- 仅ESLint支持规则数:X(Y%)
- 类型感知规则数:X(Y%)
Migration Checklist
迁移清单
- Disable X covered rules
- Review X "inspired" rules (Biome)
- Enable X additional target rules
- Migrate Prettier config
- Run both linters and compare output
undefined- 关闭X条已覆盖规则
- 检查X条“启发式等效”规则(Biome)
- 启用X条目标工具新增规则
- 迁移Prettier配置
- 运行两个检查工具并对比输出
undefinedImportant Notes
重要说明
- Scripts require the respective tools installed in the project
- Scripts auto-detect the package manager (pnpm/yarn/bun/npm)
- Version files track which Biome/Oxc versions introduced which changes
- Modernize workflow uses version files to detect stale nursery refs and suggest new features
- For doc lookups, use Context7 IDs from before web search
references/docs.md - Vite+ projects embed Oxlint/Oxfmt config in (
vite.config.ts/lintblocks) — do not create standalonefmt/.oxlintrc.jsonalongside Vite+.oxfmtrc.json - External repos accessed: (public)
typescript-eslint/typescript-eslint
- 脚本要求项目中已安装对应工具
- 脚本自动检测包管理器(pnpm/yarn/bun/npm)
- 版本文件记录Biome/Oxc各版本引入的变更
- 现代化改造工作流通过版本文件检测过时nursery引用并推荐新功能
- 文档查询优先使用中的Context7 ID,再进行网络搜索
references/docs.md - **Vite+**项目将Oxlint/Oxfmt配置嵌入的
vite.config.ts/lint区块 — 请勿在Vite+旁创建独立的fmt/.oxlintrc.json.oxfmtrc.json - 访问的外部仓库:(公开)
typescript-eslint/typescript-eslint
Bundled References
内置参考文件
- — ESLint → Biome rule mapping (~260 entries)
references/biome-eslint-mapping.json - — ESLint → Oxlint rule mapping (~520 entries)
references/oxc-eslint-mapping.json - — Biome version changelog: promotions, new rules, new options
references/biome-versions.json - — Oxc version changelog: new rules, features, recommended config
references/oxc-versions.json - — Opinionated Oxlint/Oxfmt defaults for initialization
references/oxc-defaults.json - — TypeScript-ESLint type-aware rules (~60 entries)
references/type-aware-rules.json - — Context7 library IDs and documentation URLs
references/docs.md - — Extract active ESLint rules via
scripts/get-eslint-rules.sh--print-config - — Extract active Biome rules via
scripts/get-biome-rules.shbiome rage --linter - — Extract active Oxlint rules
scripts/get-oxlint-rules.sh
- — ESLint → Biome规则映射(约260条)
references/biome-eslint-mapping.json - — ESLint → Oxlint规则映射(约520条)
references/oxc-eslint-mapping.json - — Biome版本更新日志:规则升级、新增规则、新增选项
references/biome-versions.json - — Oxc版本更新日志:新增规则、功能、推荐配置
references/oxc-versions.json - — 初始化Oxlint/Oxfmt的预设默认配置
references/oxc-defaults.json - — TypeScript-ESLint类型感知规则(约60条)
references/type-aware-rules.json - — Context7库ID和文档URL
references/docs.md - — 通过
scripts/get-eslint-rules.sh提取激活的ESLint规则--print-config - — 通过
scripts/get-biome-rules.sh提取激活的Biome规则biome rage --linter - — 提取激活的Oxlint规则
scripts/get-oxlint-rules.sh