lint-sync

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Lint Sync

Lint Sync

Purpose

用途

Two workflows in one skill:
  1. Migrate — Move ESLint/Prettier rules to Biome or Oxc with rule-by-rule comparison
  2. Modernize — Update existing Biome/Oxc configs: promote nursery rules, enable new quality flags, apply latest formatter options
本工具包含两种工作流:
  1. 迁移 — 将ESLint/Prettier规则逐步迁移至Biome或Oxc,并进行逐规则对比
  2. 现代化改造 — 更新现有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

模式

ModeTriggerDescription
syncNo mode or
sync
Quick overlap check (migrate) or nursery/feature check (modernize).
audit
audit
Full analysis with performance data, coverage stats, migration/modernization checklist.
update
update
Refresh mapping and version reference files from upstream sources.
模式触发方式描述
sync无模式或
sync
快速重叠检查(迁移场景)或nursery/功能检查(现代化改造场景)。
audit
audit
完整分析,包含性能数据、覆盖率统计、迁移/现代化改造清单。
update
update
从上游源刷新规则映射和版本参考文件。

Documentation

文档查询

Before fetching docs from the web, check
references/docs.md
for Context7 library IDs and direct URLs. This saves tokens significantly.
Context7 IDs for quick lookups:
  • Biome:
    /biomejs/website
    (5357 snippets)
  • Oxc:
    /oxc-project/website
    (5057 snippets)
  • Vite+:
    /websites/viteplus_dev
    (210 snippets)
从网络获取文档前,请先查看
references/docs.md
中的Context7库ID和直接URL,可大幅节省令牌消耗。
快速查询的Context7 ID:
  • Biome:
    /biomejs/website
    (5357个代码片段)
  • Oxc:
    /oxc-project/website
    (5057个代码片段)
  • Vite+:
    /websites/viteplus_dev
    (210个代码片段)

Asking the User

用户询问规范

Every question in this skill is written as
AskUserQuestion
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个带编号的选项(推荐选项优先,每个选项配简短描述),等待用户回复编号。

Workflow

工作流

Step 1: Detect All Configs

步骤1:检测所有配置文件

Find all relevant configuration files:
bash
undefined
查找所有相关配置文件:
bash
undefined

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

```bash
fd -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配置。

```bash

Quick Vite+ detection

快速检测Vite+

grep -l "from ['"]vite-plus['"]" vite.config.ts 2>/dev/null
undefined
grep -l "from ['"]vite-plus['"]" vite.config.ts 2>/dev/null
undefined

Step 2: Determine Workflow

步骤2:确定工作流类型

ESLint/PrettierBiomeOxc/Vite+Workflow
FoundFound-Migrate to Biome
Found-FoundMigrate to Oxc
FoundFoundFoundAsk user which target
Found--Ask user which target to migrate to
-Found-Modernize Biome
--FoundModernize Oxc
-FoundFoundModernize both (ask which first)
---Nothing to do — inform user
Vite+ counts as Oxc in the table above. When
$VITEPLUS=true
, all Oxc config reads/writes target the
lint
and
fmt
blocks in
vite.config.ts
instead of standalone config files.
Ask 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。当
$VITEPLUS=true
时,所有Oxc配置的读写操作均针对
vite.config.ts
中的
lint
和
fmt
区块,而非独立配置文件。
按照用户询问规范发起目标选择请求:
您希望迁移至哪个工具?
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/null
bash
pnpm exec eslint --version 2>/dev/null || npx eslint --version 2>/dev/null

Target-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.sh
If 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.json
For Oxc, also load
references/oxc-defaults.json
.
bash
cat references/biome-eslint-mapping.json   # 或 oxc-eslint-mapping.json
cat references/type-aware-rules.json
针对Oxc,还需加载
references/oxc-defaults.json
。

M4: Cross-Reference (Core Analysis)

M4:交叉引用(核心分析)

For each active ESLint rule, classify it:
CategoryMeaningAction
DISABLETarget has "same" equivalent AND it's activeSafe to turn off in ESLint
REVIEWTarget has "inspired" equivalent AND it's activeCheck behavior before disabling
ENABLE_TARGETTarget has equivalent but it's NOT activeCan switch by enabling in target config
ESLINT_ONLYNo target equivalent existsMust keep in ESLint
TYPE_AWARERequires TypeScript type infoExpensive; 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_TARGET
Oxc 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_TARGET
Oxc分类逻辑:
对每个激活的ESLint规则:
  1. 在oxc-eslint-mapping.json中查找(匹配顺序同上)
  2. 无映射 → 若在类型感知规则列表中则标记为TYPE_AWARE,否则为ESLINT_ONLY
     - Oxlint通过tsgolint支持类型感知规则(检查"typeAware"字段)
  3. 存在映射:
     a. 检查是否激活;所有Oxc映射均为“完全等效”关系
     b. 已激活 → DISABLE
     c. 未激活 → ENABLE_TARGET

M5: Prettier Migration Analysis

M5:Prettier迁移分析

If Prettier config found:
Biome: Map Prettier options → Biome equivalents (see table in
references/docs.md
). Note:
biome migrate prettier --write
automates this.
Oxc: Oxfmt uses Prettier-compatible option names. Key differences:
  • printWidth
    defaults to
    100
    (Prettier:
    80
    )
  • endOfLine: "auto"
    not supported
  • Built-in:
    sortImports
    ,
    sortTailwindcss
    ,
    sortPackageJson
    Note:
    oxfmt --migrate=prettier
    automates this.
Import sorting (both targets): Check if the project uses
eslint-plugin-import
sort rules,
@trivago/prettier-plugin-sort-imports
,
prettier-plugin-organize-imports
, or
@ianvs/prettier-plugin-sort-imports
. If so, recommend enabling the native import sorter:
  • Biome:
    "organizeImports": { "enabled": true }
    in
    biome.json
  • Oxfmt:
    "sortImports": { ... }
    (see defaults in
    oxc-defaults.json
    )
Tailwind class sorting (both targets): Check if
tailwindcss
is in project deps. If so, and if
prettier-plugin-tailwindcss
was in use, recommend enabling native sorting:
  • Biome: not built-in — keep the Prettier plugin or use
    biome-plugin-tailwindcss
    if available
  • Oxfmt:
    "sortTailwindcss": { ... }
    built-in (see
    oxc-defaults.json
    →
    oxfmt_ifTailwind
    )
若检测到Prettier配置:
Biome: 将Prettier选项映射为Biome等效选项(详见
references/docs.md
中的表格)。 注意:
biome migrate prettier --write
可自动完成该操作。
Oxc: Oxfmt使用与Prettier兼容的选项名称。主要差异:
  • printWidth
    默认值为
    100
    (Prettier为
    80
    )
  • 不支持
    endOfLine: "auto"
  • 内置功能:
    sortImports
    ,
    sortTailwindcss
    ,
    sortPackageJson
    注意:
    oxfmt --migrate=prettier
    可自动完成该操作。
导入排序(两种目标工具): 检查项目是否使用
eslint-plugin-import
排序规则、
@trivago/prettier-plugin-sort-imports
、
prettier-plugin-organize-imports
或
@ianvs/prettier-plugin-sort-imports
。若使用,建议启用原生导入排序功能:
  • Biome: 在
    biome.json
    中设置
    "organizeImports": { "enabled": true }
  • Oxfmt: 设置
    "sortImports": { ... }
    (详见
    oxc-defaults.json
    中的默认配置)
Tailwind类排序(两种目标工具): 检查项目依赖中是否包含
tailwindcss
。若包含且曾使用
prettier-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.json
.
Before writing config, check project dependencies:
bash
undefined
若不存在Oxc配置,可基于
references/oxc-defaults.json
创建。
写入配置前,检查项目依赖:
bash
undefined

Check 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
.oxlintrc.json
and
.oxfmtrc.json
.
jq -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.json
。

M7: 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:
    biome.json
    or
    biome.jsonc
  • Oxc standalone:
    .oxlintrc.json
    and
    .oxfmtrc.json
  • Vite+ (
    $VITEPLUS=true
    ): parse
    lint
    and
    fmt
    blocks from
    vite.config.ts
读取并解析工具的配置文件:
  • Biome:
    biome.json
    或
    biome.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/null
bash
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
undefined
pnpm exec oxlint --version 2>/dev/null || npx oxlint --version 2>/dev/null
undefined

N3: Load Version History

N3:加载版本历史

bash
cat references/biome-versions.json   # or oxc-versions.json
Determine 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
nursery/
category. Cross-reference against
biome-versions.json
→
promotedFromNursery
entries for the installed version and all prior tracked versions.
For each stale nursery reference found:
Current (stale)Should bePromoted in
nursery/noConsole
suspicious/noConsole
v2.4
nursery/noSecrets
security/noSecrets
v2.3
Generate a ready-to-apply diff or config patch.
扫描用户配置中所有引用
nursery/
分类的规则。与
biome-versions.json
中已安装版本及所有历史版本的
promotedFromNursery
条目交叉对比。
针对每个找到的过时nursery引用:
当前(过时)规则应升级为升级版本
nursery/noConsole
suspicious/noConsole
v2.4
nursery/noSecrets
security/noSecrets
v2.3
生成可直接应用的差异或配置补丁。

N5: Suggest New Quality Rules

N5:推荐新质量规则

Biome: Check
biome-versions.json
for
newRules
in versions newer than user's mapping date. Highlight rules that are:
  • Promoted to stable (non-nursery) — safe to enable
  • Commonly useful (e.g.,
    noUnusedExpressions
    ,
    noImportCycles
    ,
    noFloatingPromises
    )
  • New formatter options (e.g.,
    trailingNewline
    in v2.4)
Oxc: Check
oxc-versions.json
for
recommendedConfig
rules not yet in user's config. Suggest:
  • Categories worth enabling (
    suspicious
    ,
    perf
    )
  • High-value rules from
    oxc-versions.json
    →
    recommendedConfig.rules
  • New features (type-aware linting, Vue support, config extends)
Biome: 检查
biome-versions.json
中比用户映射日期更新的版本中的
newRules
。重点推荐以下规则:
  • 已升级为稳定版(非nursery)— 可安全启用
  • 常用实用规则(如
    noUnusedExpressions
    ,
    noImportCycles
    ,
    noFloatingPromises
    )
  • 新格式化选项(如v2.4中的
    trailingNewline
    )
Oxc: 检查
oxc-versions.json
中用户配置尚未包含的
recommendedConfig
规则。推荐:
  • 值得启用的分类(
    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.json
Biome: Check
biome-versions.json
for
newFormatterOptions
. Highlight useful additions:
  • formatter.trailingNewline
    (v2.4)
  • formatter.lineEnding: "auto"
    (v2.3)
  • formatter.expand
    for array/object control
  • organizeImports.enabled: true
    if not already on — replaces import-sort plugins
  • Note: Biome does not have built-in Tailwind class sorting
Oxc/Vite+: Check if Oxfmt features are underutilized:
  • sortImports
    (off by default, high value — replaces import-sort plugins)
  • sortTailwindcss
    (if Tailwind in deps — replaces
    prettier-plugin-tailwindcss
    )
  • jsdoc
    formatting (off by default)
  • For Vite+:
    lint.options.typeAware
    and
    lint.options.typeCheck
    (recommended on)
先检查项目依赖:
bash
jq -r '.dependencies.tailwindcss // .devDependencies.tailwindcss // empty' package.json
Biome: 检查
biome-versions.json
中的
newFormatterOptions
。重点推荐实用新增选项:
  • formatter.trailingNewline
    (v2.4)
  • formatter.lineEnding: "auto"
    (v2.3)
  • formatter.expand
    用于数组/对象格式控制
  • 若未启用则推荐
    organizeImports.enabled: true
    — 替代导入排序插件
  • 注意:Biome无内置Tailwind类排序功能
Oxc/Vite+: 检查Oxfmt功能是否未充分利用:
  • sortImports
    (默认关闭,高价值 — 替代导入排序插件)
  • sortTailwindcss
    (若包含Tailwind依赖 — 替代
    prettier-plugin-tailwindcss
    )
  • jsdoc
    格式化(默认关闭)
  • 针对Vite+:推荐启用
    lint.options.typeAware
    和
    lint.options.typeCheck

N7: Generate Modernize Report

N7:生成现代化改造报告

markdown
undefined
markdown
undefined

Modernize 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:
CurrentUpdatedVersion
nursery/noSecrets
security/noSecrets
v2.3
您的配置中有X条规则仍引用nursery/但已升级至稳定版:
当前规则升级后规则升级版本
nursery/noSecrets
security/noSecrets
v2.3

New Rules Available

可用新规则

These rules are stable and recommended but not in your config:
RuleCategoryDescription
noImportCycles
suspiciousDetect circular imports
以下规则已稳定且推荐启用,但尚未加入您的配置:
规则分类描述
noImportCycles
suspicious检测循环导入

New Formatter Options

新格式化选项

OptionValueSince
trailingNewline
true
v2.4
选项推荐值新增版本
trailingNewline
true
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

  1. Fetch
    https://biomejs.dev/linter/rules-sources/
  2. Parse ESLint → Biome rule mappings
  3. Diff against existing, show added/removed
  4. Update
    _meta.biomeVersion
    and
    _meta.updatedAt
  1. 获取
    https://biomejs.dev/linter/rules-sources/
  2. 解析ESLint → Biome规则映射
  3. 与现有文件对比,展示新增/移除条目
  4. 更新
    _meta.biomeVersion
    和
    _meta.updatedAt

U2: Update oxc-eslint-mapping.json

U2:更新oxc-eslint-mapping.json

  1. Fetch
    https://oxc.rs/docs/guide/usage/linter/rules
  2. Parse supported rules by plugin
  3. Diff against existing, show added/removed
  4. Update
    _meta.oxlintVersion
    and
    _meta.updatedAt
  1. 获取
    https://oxc.rs/docs/guide/usage/linter/rules
  2. 解析各插件支持的规则
  3. 与现有文件对比,展示新增/移除条目
  4. 更新
    _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 -d
Parse, diff, update
_meta.updatedAt
.
bash
gh api repos/typescript-eslint/typescript-eslint/contents/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts --jq '.content' | base64 -d
解析、对比、更新
_meta.updatedAt
。

U4: Update version files

U4:更新版本文件

Check Biome and Oxc changelogs for new versions not yet tracked:
  • Biome:
    https://biomejs.dev/blog/
    — look for new
    biome-vX-Y
    posts
  • Oxc:
    https://oxc.rs/blog/
    — look for new release posts
For each new version found, add entry to
biome-versions.json
or
oxc-versions.json
with:
  • 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.json
或
oxc-versions.json
添加条目,包含:
  • 升级的规则
  • 新增规则
  • 新增格式化选项
  • 新增功能

Report Templates

报告模板

Sync Mode (Migration)

Sync模式(迁移)

markdown
undefined
markdown
undefined

Lint 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

摘要

CategoryCount
DISABLE (safe to remove)X
REVIEW (check before removing)X
ENABLE_TARGET (can migrate)X
ESLINT_ONLY (must keep)X
TYPE_AWAREX
分类数量
DISABLE(可安全移除)X
REVIEW(移除前需检查)X
ENABLE_TARGET(可迁移)X
ESLINT_ONLY(必须保留)X
TYPE_AWARE(类型感知)X

DISABLE — Safe to Turn Off in ESLint

DISABLE — 可安全关闭的ESLint规则

ESLint RuleTarget Equivalent
ESLint规则目标工具等效规则

REVIEW — Check Before Disabling

REVIEW — 关闭前需检查的规则

ESLint RuleTarget EquivalentNotes
ESLint规则目标工具等效规则注意事项

ENABLE_TARGET — Available to Migrate

ENABLE_TARGET — 可迁移至目标工具的规则

ESLint RuleTarget EquivalentRelationship
ESLint规则目标工具等效规则等效关系

ESLINT_ONLY — Must Keep

ESLINT_ONLY — 必须保留的规则

ESLint RuleType-Aware?
ESLint规则是否为类型感知规则?

Prettier Migration (if applicable)

Prettier迁移(若适用)

Prettier OptionCurrent ValueTarget OptionTarget DefaultAction
Prettier选项当前值目标工具选项目标工具默认值操作建议

Ready-to-Paste Config

可直接粘贴的配置

undefined
undefined

Audit Mode (adds to Sync)

Audit模式(在Sync模式基础上添加)

markdown
undefined
markdown
undefined

Performance Analysis

性能分析

Top 10 Slowest Rules

最慢的10条规则

RuleTime (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配置
  • 运行两个检查工具并对比输出
undefined

Important 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
    references/docs.md
    before web search
  • Vite+ projects embed Oxlint/Oxfmt config in
    vite.config.ts
    (
    lint
    /
    fmt
    blocks) — do not create standalone
    .oxlintrc.json
    /
    .oxfmtrc.json
    alongside Vite+
  • External repos accessed:
    typescript-eslint/typescript-eslint
    (public)
  • 脚本要求项目中已安装对应工具
  • 脚本自动检测包管理器(pnpm/yarn/bun/npm)
  • 版本文件记录Biome/Oxc各版本引入的变更
  • 现代化改造工作流通过版本文件检测过时nursery引用并推荐新功能
  • 文档查询优先使用
    references/docs.md
    中的Context7 ID,再进行网络搜索
  • **Vite+**项目将Oxlint/Oxfmt配置嵌入
    vite.config.ts
    的
    lint
    /
    fmt
    区块 — 请勿在Vite+旁创建独立的
    .oxlintrc.json
    /
    .oxfmtrc.json
  • 访问的外部仓库:
    typescript-eslint/typescript-eslint
    (公开)

Bundled References

内置参考文件

  • references/biome-eslint-mapping.json
    — ESLint → Biome rule mapping (~260 entries)
  • references/oxc-eslint-mapping.json
    — ESLint → Oxlint rule mapping (~520 entries)
  • references/biome-versions.json
    — Biome version changelog: promotions, new rules, new options
  • references/oxc-versions.json
    — Oxc version changelog: new rules, features, recommended config
  • references/oxc-defaults.json
    — Opinionated Oxlint/Oxfmt defaults for initialization
  • references/type-aware-rules.json
    — TypeScript-ESLint type-aware rules (~60 entries)
  • references/docs.md
    — Context7 library IDs and documentation URLs
  • scripts/get-eslint-rules.sh
    — Extract active ESLint rules via
    --print-config
  • scripts/get-biome-rules.sh
    — Extract active Biome rules via
    biome rage --linter
  • scripts/get-oxlint-rules.sh
    — Extract active Oxlint rules
  • references/biome-eslint-mapping.json
    — ESLint → Biome规则映射(约260条)
  • references/oxc-eslint-mapping.json
    — ESLint → Oxlint规则映射(约520条)
  • references/biome-versions.json
    — Biome版本更新日志:规则升级、新增规则、新增选项
  • references/oxc-versions.json
    — Oxc版本更新日志:新增规则、功能、推荐配置
  • references/oxc-defaults.json
    — 初始化Oxlint/Oxfmt的预设默认配置
  • references/type-aware-rules.json
    — TypeScript-ESLint类型感知规则(约60条)
  • references/docs.md
    — Context7库ID和文档URL
  • scripts/get-eslint-rules.sh
    — 通过
    --print-config
    提取激活的ESLint规则
  • scripts/get-biome-rules.sh
    — 通过
    biome rage --linter
    提取激活的Biome规则
  • scripts/get-oxlint-rules.sh
    — 提取激活的Oxlint规则