Skip to content

chore(lint): migrate from eslint to oxlint#242

Merged
chhoumann merged 2 commits into
masterfrom
chore/oxlint-migration
Jul 6, 2026
Merged

chore(lint): migrate from eslint to oxlint#242
chhoumann merged 2 commits into
masterfrom
chore/oxlint-migration

Conversation

@chhoumann

Copy link
Copy Markdown
Owner

Replaces eslint with oxlint as the lint gate, per the direction that the oxc/vite-plus toolchain is where this repo is headed (obsidian-e2e already vendors the whole vite-plus pack, so oxlint was literally sitting in node_modules).

Parity with the old setup - nothing lost:

  • typescript/unicorn/oxc/import plugins + correctness category replace the js/ts recommended sets; consistent-type-imports, no-unused-vars (args: none), and import/no-duplicates carried over explicitly.
  • eslint-plugin-obsidianmd runs unchanged under oxlint's jsPlugins - all 7 community-review guideline rules verified firing with seeded violations, including the nested-name ones (commands/no-plugin-name-in-command-name, settings-tab/no-manual-html-headings), plus the no-restricted-globals app/fetch/localStorage policy with the original messages.
  • eslint survives only as an internal dependency of eslint-plugin-obsidianmd; our direct eslint/@typescript-eslint/import-x devDeps and eslint.config.mjs are removed.

Bonus: oxlint found real issues eslint missed, fixed here:

  • main.ts imported ./store twice through different specifiers (src/store alias + relative ./store) - import-x never resolved them as the same module; merged.
  • Useless ?? {} fallbacks in the loadedData spreads in main.ts.
  • Ambiguous new Array(n) in assertFetchableUrl.ts and TranscriptionService.tsArray.from({ length: n }).
  • Unsafe optional-chain calls in main.activateView.test.ts (a missing command would have thrown TypeError instead of a useful assertion).

Svelte files stay excluded, matching the old ts-only eslint globs (svelte-check owns those; oxlint's no-unassigned-vars false-positives on export let props).

Lint now runs in about a second. Verified: lint, biome format:check (now covers .oxlintrc.json), typecheck, build, 876/876 tests.

Note for the TS 7 path: typescript-eslint is out of our direct deps, but it lingers as a peer of eslint-plugin-obsidianmd, whose range (<6.1.0) will still gate a TS 7 install until upstream widens it. By TS 7 stable that should be resolved.

oxlint runs the same policy surface in ~1s with no typescript peer
constraint of its own:

- typescript/unicorn/oxc/import plugins + correctness category cover
  the old js/ts recommended sets; consistent-type-imports,
  no-unused-vars(args:none) and import/no-duplicates carried over
- eslint-plugin-obsidianmd runs unchanged via oxlint jsPlugins (all 7
  guideline rules verified firing, incl. nested-name rules) along with
  the no-restricted-globals app/fetch/localStorage policy
- eslint itself remains only as an internal dependency of
  eslint-plugin-obsidianmd; our direct eslint/typescript-eslint/
  import-x devDeps and eslint.config.mjs are gone

Fixes for real issues oxlint surfaced that eslint missed:
- main.ts imported ./store twice via different specifiers (src/store
  and ./store) - merged
- useless {} fallbacks in loadedData spreads (main.ts)
- ambiguous new Array(n) in assertFetchableUrl + TranscriptionService
- unsafe optional-chain calls in main.activateView.test.ts

Svelte files are excluded (parity with the old ts-only eslint globs;
svelte-check owns those).
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 6, 2026

Copy link
Copy Markdown

Deploying podnotes with  Cloudflare Pages  Cloudflare Pages

Latest commit: cefd418
Status: ✅  Deploy successful!
Preview URL: https://62cd1763.podnotes.pages.dev
Branch Preview URL: https://chore-oxlint-migration.podnotes.pages.dev

View logs

@chhoumann chhoumann marked this pull request as ready for review July 6, 2026 15:06

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread .oxlintrc.json
Comment thread .oxlintrc.json
… config

The repo lints clean either way today; pinning ban-ts-comment,
no-empty-function and no-prototype-builtins off guards against these
activating via category changes in future oxlint upgrades.
@chhoumann chhoumann merged commit 526b844 into master Jul 6, 2026
3 checks passed
@chhoumann chhoumann deleted the chore/oxlint-migration branch July 6, 2026 15:14
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.17.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant