Skip to content

oxlint & oxfmt#176

Draft
Hinton wants to merge 3 commits intopnpmfrom
oxc
Draft

oxlint & oxfmt#176
Hinton wants to merge 3 commits intopnpmfrom
oxc

Conversation

@Hinton
Copy link
Copy Markdown
Member

@Hinton Hinton commented Apr 23, 2026

Ticket

Description

Modernizes the repo tooling.

Prettier → Oxfmt for formatting; ESLint 8 (legacy .eslintrc.json)
ESLint → Oxlint; added Oxlint as a fast first-pass linter running alongside ESLint.

No runtime/content changes — this is tooling only. Only two files are formatted/linted with real logic (src/.vuepress/config.ts and src/.vuepress/components/SwaggerComponent.vue); the rest is Markdown, SCSS, and JSON.

Shape

Formatting (Oxfmt)

  • .oxfmtrc.json generated via oxfmt --migrate=prettier. endOfLine: auto dropped as unsupported; ignore patterns migrated. One minor reformat in palette.scss (multi-line --font-family value) and one in SwaggerComponent.vue (empty <div></div> normalized to self-closing <div />, a hardcoded Oxfmt behavior for empty non-void Vue elements).

Linting (Oxlint + ESLint)

  • Oxlint config (.oxlintrc.json) enables the full Correctness category plus explicit overrides for the handful of eslint:recommended rules that live in other categories (Pedantic/Restriction/Suspicious). Net effect vs. the old eslint:recommended: same 66 rules preserved, +19 new Correctness rules gained.
  • ESLint moved to flat config:
    • Deleted .eslintrc.json and .eslintignore (flat config ignores the latter).
    • eslint.config.mjs composes @eslint/js, eslint-plugin-vue (flat/recommended), eslint-config-prettier, a files/globals block providing browser + node globals for .js/.mjs/.cjs/.ts/.vue, and eslint-plugin-oxlint's buildFromOxlintConfigFile() last to disable rules Oxlint already runs.
    • ESLint's role is now primarily eslint-plugin-vue template linting (Oxlint only lints the <script> block of .vue files).
  • Scripts: oxfmt → oxlint → eslint chained in lint / lint:check.

ESLint v10 ecosystem versions

  • eslint@^10, @eslint/js@^10, eslint-plugin-vue@^10, vue-eslint-parser@^10 (explicit because it's a peer dep), eslint-config-prettier@^10, globals@^17.

Checklist

I did the following to ensure that my changes were tested thoroughly:

  • Ran pnpm run lint:check — oxfmt, oxlint (85 rules on 3 files), and eslint all pass clean on a fresh clone.
  • Ran pnpm run build — Vuepress build succeeds (34 pages rendered).
  • Seeded a no-unused-vars violation in a .ts file and confirmed Oxlint flags it while ESLint stays silent (verifies eslint-plugin-oxlint disables overlapping rules correctly).
  • Seeded a vue/no-duplicate-attributes violation in a .vue template and confirmed ESLint flags it (verifies Vue template linting is preserved).
  • Verified both .ts and .vue files are actually linted by ESLint via --debug output.

I did the following to ensure that my changes do not introduce security vulnerabilities:

  • Tooling-only change; no runtime code, auth, or data-handling surface is touched.
  • All new/upgraded packages are from the official Oxc and ESLint ecosystems.

Hinton added 3 commits April 23, 2026 13:27
Replaces prettier and prettier-plugin-organize-imports with oxfmt.
Config migrated via `oxfmt --migrate=prettier` (endOfLine: auto dropped
as unsupported). Lint scripts now call `oxfmt` / `oxfmt --check`.
Runs oxfmt → oxlint → eslint in lint scripts. Oxlint config enables the
full Correctness category plus explicit overrides for the handful of
eslint:recommended rules that live in other categories. eslint.config.mjs
uses oxlint.buildFromOxlintConfigFile() so ESLint only runs rules oxlint
can't cover (mainly eslint-plugin-vue template rules).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant