Uh oh!
There was an error while loading. Please reload this page.
chore: migrate JS/TS tooling to oxlint and oxfmt (backport #381) - #385
Merged
Conversation
Backport of #381 to main. The upstream squash commit could not be cherry-picked — main is 57 commits behind develop, and a whole-repo reformat conflicts against every line that has moved since, 68 files in total. Roughly 50 of those files do not exist on main at all. So the reformat is regenerated rather than ported: this commit carries only the tooling config, and the formatter is re-run against main's own tree in a following commit. The configs themselves are byte-identical to develop's. The problem being fixed is the same one #381 describes. Biome owned `dashboard/` via `yarn lint`, while the pre-commit prettier hook matched `types_or: [javascript, vue, scss]` with no exclude for `dashboard/`, so it reformatted every Vue file on commit — `.ts` without semicolons, `.vue` with them, and nothing in CI to catch it. Notes carried over from #381: - Both pre-commit mirrors default to `types_or: [javascript, jsx, ts, tsx]`, which silently skips every `.vue` file. Both hooks override it. - `.oxfmtrc.json` sets `useTabs` explicitly because `.editorconfig` covers `*.js,*.vue,*.css,*.scss,*.html` but not `*.ts`. - oxfmt also formats JSON, Markdown, YAML, TOML, HTML and CSS. DocType schemas have Frappe-specific formatting, so `ignorePatterns` restricts oxfmt to JS/TS/Vue, matching the hook's `types_or`. - `eslint:recommended` is not a subset of oxlint's correctness and suspicious categories. The six rules that fall outside them are listed explicitly. `no-console` is scoped to `buzz/**/*.js`, the only place the old `types_or: [javascript]` hook ever applied it. - The ~90-entry `globals` block in `.eslintrc` existed only to satisfy `no-undef`, which oxlint ships as a nursery rule. Dropped, not ported. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Backport of #381's fix commit. Applied to main's own files rather than cherry-picked, since three of them have diverged. The findings turned out to be identical to develop's minus the files main does not have yet. Three were real bugs rather than style: - `RegisterInterest.vue` declared a `campaign` prop and a local `campaign` ref for the fetched document. In `<script setup>` the local binding shadows the prop, so the template worked by accident. The ref is now `campaignDoc`. - `FormFieldSections.vue` declared `sections` inside the `sections` computed, shadowing it. - `global.d.ts` nested ambient module declarations inside `declare global`, which is not legal. Dropping `export {}` makes the file script-scope, so the `Window` interface and the wildcard modules both work at top level. vue-tsc never surfaced this. The rest are mechanical: unused catch bindings, unused parameters and imports, and redundant regex escapes. Two suppressions rather than fixes. `unicorn/no-array-sort` wants `toSorted()`, but Vite does not polyfill built-in methods, and the call site sorts an array it just created, so the mutation is not observable. `CustomFieldInput`'s `defineModel` is typed `any` because Frappe field values are heterogeneous and the template binds the model straight into components that expect a string. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Pure `oxfmt` output, no hand edits. Regenerated against main rather than ported from #381, so this is main's own reformat — 114 files here against 164 there, the difference being files develop has and main does not. Two visible differences from before. `sortImports` replaces Biome's `organizeImports` and uses a different ordering, so import blocks reshuffle. And oxfmt formats `<template>` and `<style>` blocks, which Biome never touched — it only handled `<script>` — so Vue markup reflows to the 100 column width. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Too many files changed for review (139 files, 100 file limit). Bypass the limit by tagging |
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
What changed
Backport of #381 to
main. Same outcome — oxlint and oxfmt replace ESLint, Prettier and Biome across the dashboard, desk scripts ande2e/— but regenerated, not cherry-picked.The automated backport failed, and re-running it will not help.
mainis 57 commits behinddevelop, so the squash commit conflicted on 68 files: 50 that do not exist onmainat all (the teams and event-management work), and 18 that have diverged. A whole-repo reformat is derived output; every formatting hunk collides with any line that has moved.So only the tooling config was ported — the configs are byte-identical to
develop's — and the formatter was re-run againstmain's own tree. Zero conflicts by construction. The result ismain's own reformat: 114 files here against 164 ondevelop.The lint findings turned out to be identical to
develop's minus the filesmaindoes not have yet, so the same three real bugs are fixed here: a prop shadowed by a same-named ref inRegisterInterest.vue(the template worked by accident), asectionsshadow inside its own computed inFormFieldSections.vue, and ambient modules illegally nested indeclare globalinglobal.d.ts— which vue-tsc never surfaced.Gotchas, same as #381:
types_or: [javascript, jsx, ts, tsx]— novue. Left alone they silently skip the entire dashboard. Both hooks override it.ignorePatternsrestricts it to JS/TS/Vue, matching the hook. Verified: zero DocType schemas touched..oxfmtrc.jsonsetsuseTabsexplicitly because.editorconfigcovers*.js,*.vue,*.css,*.scss,*.htmlbut not*.ts.eslint:recommendedis not a subset of oxlint'scorrectness+suspicious; the six rules outside them are listed explicitly.no-consoleis scoped tobuzz/**/*.js, the only place the old hook applied it.Read commit by commit — the 114-file reformat is its own commit.
Note for whoever merges: this closes a real tax. Until it lands,
mainanddevelopare on different toolchains, so any future backport touching dashboard files conflicts on formatting alone. It will also force PR #317 to be re-resolved against a reformatted tree — that PR is a draft, so this was raised now rather than waiting on it.Demo
No visual change — formatting and lint config only. Applying
skip-demo.Testing
npx oxlint --deny-warningsrepo-widenpx oxfmt --check .yarn typecheckyarn test:unityarn buildpre-commit run --all-filesgit status -- 'buzz/**/*.json'E2E left to CI.
🤖 Generated with Claude Code