Repository navigation
chore: migrate lint and format from ESLint+Prettier to oxlint+oxfmt - #97
Merged
Merged
Conversation
Replaces the ESLint flat configs in packages/errors and apps/web and the root .prettierrc with a single oxlint + oxfmt setup. - Add oxlint@^1.87 and oxfmt@^0.72 as root dev dependencies. - Remove eslint, @eslint/js, typescript-eslint, eslint-config-next. - New root configs: .oxlintrc.json and .oxfmtrc.json (migrated from .prettierrc). - Per-workspace configs at packages/errors/.oxlintrc.json and apps/web/.oxlintrc.json. A local override at apps/web/tests/seo/fixtures/.oxlintrc.json disables eslint/no-await-in-loop for the test fixture. - Scripts: root format and format:check now use oxfmt; per-workspace lint and lint:fix use oxlint. lint-staged invokes oxfmt and oxlint --fix. - Husky pre-commit now runs pnpm exec lint-staged && pnpm format:check && pnpm turbo type-check. Developer-tooling change only. The published artifact, the public API, and the runtime behavior are unchanged. Oxfmt reformatted existing source files to match its style. Four source fixes were required, all driven by rules that did not exist in the prior ESLint config: - packages/errors/tests/edge-cases.test.ts: inline import() type annotation replaced with a proper type import. - apps/web/src/app/sitemap.ts: merged two duplicate imports. - apps/web/proxy.ts: split NextRequest (type) from NextResponse (value) to mark the type-only import. - apps/web/tests/seo/fixtures/stubs/fumadocs.ts: left as-is; the await-in-loop is intentional and the rule is disabled in the local override. Validated: - pnpm lint 0 errors, 4 warnings (non-blocking) - pnpm format:check clean - pnpm type-check clean, both packages - pnpm test all tests pass - pnpm build clean, both packages
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.
Mirrors the migration landed in deessejs/fp PR #444. Replaces the ESLint flat configs in packages/errors and apps/web and the root .prettierrc with a single oxlint + oxfmt setup.
What
oxlint@^1.87andoxfmt@^0.72as root dev dependencies.eslint,@eslint/js,typescript-eslint, andeslint-config-next..oxlintrc.jsonand.oxfmtrc.json(the latter migrated from.prettierrc).packages/errors/.oxlintrc.jsonandapps/web/.oxlintrc.json. A local override atapps/web/tests/seo/fixtures/.oxlintrc.jsondisableseslint/no-await-in-loopfor that test fixture (the sequential awaits are intentional).formatandformat:checknow useoxfmt; per-workspacelintandlint:fixuseoxlint.lint-stagedinvokesoxfmtandoxlint --fix.pnpm exec lint-staged && pnpm format:check && pnpm turbo type-checkso format drift is caught on commit, not in CI.Why
oxlint is a Rust-based linter that is materially faster than ESLint (single-digit seconds across the full workspace). oxfmt is its companion formatter. Together they replace the ESLint + Prettier pair with a single toolchain, drop the
typescript-eslintplugin, and remove the legacyeslint-config-nextthat the web app was depending on without its own lint script. The migration also surfaces a class of issues that the prior ESLint config did not flag (e.g.consistent-type-imports,no-await-in-loop).Source fixes driven by the migration
Four files were touched to satisfy rules that did not exist in the prior ESLint config:
packages/errors/tests/edge-cases.test.ts: inlineimport('@standard-schema/spec').StandardSchemaV1annotation replaced with a proper type import.apps/web/src/app/sitemap.ts: two duplicate imports from@/lib/sourcemerged.apps/web/proxy.ts:NextRequest(type) split fromNextResponse(value) to mark the type-only import.apps/web/tests/seo/fixtures/stubs/fumadocs.ts: left as-is; theawait in loopis intentional and the rule is disabled in the local override.Validation
pnpm lint— 0 errors, 4 warnings (non-blocking; the same warning classes that deessejs/fp landed with)pnpm format:check— cleanpnpm type-check— clean, both packagespnpm test— all tests passpnpm build— clean, both packagesNotes
@deessejs/errorsartifact, the public API, and the runtime behavior are unchanged.