Skip to content

版本控制策略

🌐 Versioning policy

Oxlint 遵循语义化版本控制,旨在在升级时提供清晰性和可预测性。

🌐 Oxlint follows semantic versioning, with the goal of providing clarity and predictability as you upgrade.

什么被认为是重大更改:

🌐 What's considered a breaking change:

  • 对 CLI 界面的更改会破坏现有工作流程。
  • 对配置文件(.oxlintrc.json)的更改可能会破坏现有设置。
  • 重命名或删除规则。

被认为是非破坏性更改的情况:

🌐 What's considered a non-breaking change:

  • 添加新的绒毛规则。
  • 更改规则的默认配置。
  • 改进规则描述或诊断信息。
  • 向现有规则添加新的配置选项。
  • 修复更改规则行为以更好地与原始 ESLint 规则的行为一致的问题。
  • 向配置文件添加新字段。

不受语义化版本控制的功能

🌐 Features Not Subject to Semver

以下功能是实验性的,不受语义化版本控制的约束。它们可能随时引入破坏性更改,即使在补丁或次要版本中也可能如此:

🌐 The following features are experimental and are not subject to semantic versioning. They may introduce breaking changes at any time, even in patch or minor releases:

  • JavaScript 自定义插件 - 插件的 API 和行为可能会在不通知的情况下发生变化。
  • 类型感知的代码检查 - 随着此功能的发展,类型感知规则及其行为可能会发生变化。

新的 Lint 错误是重大变更吗?

🌐 Are New Lint Errors a Breaking Change?

如果 Oxlint 的新版本在你的代码中报告了更多问题,这是正常的。这种情况意味着 Oxlint 得到了改进——而不是你的项目出现了问题。新的错误反映了更严格的分析,而不是升级出错。

🌐 If a new version of Oxlint reports additional issues in your code, that’s expected. This behavior means Oxlint has improved — not that something in your project broke. New errors reflect stronger analysis, not a broken upgrade.

新版本的期待

🌐 What to Expect from New Versions

  • 补丁版本(1.0.x):修复漏洞、提升性能、内部重构。这些升级总是安全的。
  • 次版本 (1.x.0):新规则、更好的诊断能力、新功能。即使它们导致你的代码库中出现新错误,也不被视为破坏性更改。
  • 主版本 (x.0.0):保留用于对 CLI 或配置格式的重大更改。

使用 Renovate 机器人

🌐 With Renovate Bot

将以下代码片段添加到你的 Renovate 配置中,以便自动保持 Oxlint 的最新状态。

🌐 Add the snippet below to your Renovate config to let it keep Oxlint automatically up to date.

renovate.json
json
{
  "extends": ["config:recommended"],
  "packageRules": [
    {
      "matchPackageNames": ["oxlint"],
      "groupName": "oxlint",
      "automergeType": "branch",
      "stabilityDays": 1
    }
  ]
}

如果你使用 eslint-plugin-oxlint,请确保在更新 Oxlint 的同时也更新它,以避免兼容性问题。

🌐 If you use eslint-plugin-oxlint, ensure that it is also updated alongside Oxlint to avoid compatibility issues.

使用 Dependabot

🌐 With Dependabot

将以下代码片段添加到你的 Dependabot 配置中,以便它自动保持 Oxlint 的最新版本。

🌐 Add the snippet below to your Dependabot config to let it keep Oxlint automatically up to date.

yaml
version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/" # location of package.json
    schedule:
      interval: "daily"
    groups: # group all Oxlint updates together
      oxlint:
        patterns:
          - "oxlint"
    commit-message: # keep the history tidy
      prefix: "chore"
      include: "scope"
    ignore: # optional: ignore future majors
      - dependency-name: "oxlint"
        update-types: ["version-update:semver-major"]
    open-pull-requests-limit: 1 # one PR at a time

如果你使用 eslint-plugin-oxlint,请确保在更新 Oxlint 的同时也更新它,以避免兼容性问题。

🌐 If you use eslint-plugin-oxlint, ensure that it is also updated alongside Oxlint to avoid compatibility issues.