chore(lint): migrate from eslint to oxlint#242
Merged
Conversation
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).
Deploying podnotes with
|
| Latest commit: |
cefd418
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://62cd1763.podnotes.pages.dev |
| Branch Preview URL: | https://chore-oxlint-migration.podnotes.pages.dev |
… 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.
|
🎉 This PR is included in version 2.17.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
correctnesscategory replace the js/ts recommended sets;consistent-type-imports,no-unused-vars(args: none), andimport/no-duplicatescarried over explicitly.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 theno-restricted-globalsapp/fetch/localStorage policy with the original messages.Bonus: oxlint found real issues eslint missed, fixed here:
main.tsimported./storetwice through different specifiers (src/storealias + relative./store) - import-x never resolved them as the same module; merged.?? {}fallbacks in theloadedDataspreads inmain.ts.new Array(n)inassertFetchableUrl.tsandTranscriptionService.ts→Array.from({ length: n }).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-varsfalse-positives onexport letprops).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.