Skip to content

chore: replace prettier with oxfmt and oxlint#56

Open
nicknisi wants to merge 2 commits intomainfrom
nicknisi/formatting-and-linting
Open

chore: replace prettier with oxfmt and oxlint#56
nicknisi wants to merge 2 commits intomainfrom
nicknisi/formatting-and-linting

Conversation

@nicknisi
Copy link
Member

@nicknisi nicknisi commented Mar 11, 2026

Summary

  • Replace prettier with oxfmt (formatter) and oxlint (linter) for faster, Rust-based tooling
  • Add .oxfmtrc.json and .oxlintrc.json config files (same formatting rules as previous prettier config)
  • Update CI to run format:check and enable the previously commented-out lint step
  • Fix 8 lint warnings: unused params, catch bindings, and dead imports in test files
  • Remove unused Coana workflow files

Test plan

  • pnpm format:check passes (0 issues, 91 files)
  • pnpm lint passes (0 warnings, 0 errors, 58 files)
  • pnpm test passes (175 tests)
  • CI workflow runs format and lint steps successfully

- Swap prettier for oxfmt (formatter) and oxlint (linter)
- Add .oxfmtrc.json and .oxlintrc.json configs
- Update CI workflow to run format:check and lint steps
- Fix lint warnings: unused params, catch bindings, dead imports
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 11, 2026

Greptile Summary

This PR replaces prettier with oxfmt (formatter) and oxlint (linter) — Rust-based tooling that offers significantly faster execution — while preserving all the same formatting rules. The CI pipeline is updated to enforce both format:check and lint on every run (the lint step was previously commented out), and the prepublishOnly gate now includes both checks as well. Eight accompanying lint-warning fixes (unused catch bindings, unused parameters, and dead imports in test files) are clean and correct.

Key changes:

  • prettier.config.js and both .prettierignore files removed; replaced by .oxfmtrc.json and .oxlintrc.json with equivalent settings
  • package.json scripts updated: prettierformat:check, format now uses oxfmt, new lint script added
  • CI now runs both Format and Lint steps on every push/PR
  • Source code fixes: unused catch bindings (catch (error)catch, catch (e)catch), unused params prefixed with _, and unused named imports converted to side-effect imports in server-functions.spec.ts (required to preserve the vi.mock hoisting behaviour for @tanstack/react-start/server and ./authkit-loader)

Confidence Score: 5/5

  • This PR is safe to merge — it is a pure tooling swap with no changes to production logic.
  • All changes are confined to developer tooling configuration, CI workflow, and test-file lint cleanups. No production source code behaviour is altered, and the test suite (175 tests), format check, and lint all pass according to the test plan.
  • No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Renamed Prettier step to Format (using oxfmt) and uncommented/enabled the Lint step — straightforward CI update with no issues.
.oxfmtrc.json New oxfmt config that mirrors the previous prettier.config.js settings (trailingComma, tabWidth, semi, singleQuote, printWidth) with matching ignore patterns.
.oxlintrc.json Minimal oxlint config with no custom rules enabled; ignores dist/ and generated route tree file.
package.json Replaced prettier with oxfmt + oxlint devDependencies; updated scripts (format, format:check, lint) and prepublishOnly to include format:check and lint gates.
src/server/server-functions.spec.ts Fixed unused-import lint warnings: named imports of getRequest and getAuthkit converted to side-effect imports (required for vi.mock hoisting) and options → _options for unused mock param.
src/client/AuthKitProvider.tsx Unused catch binding (error) removed — the catch block never referenced the error, so this is a safe cleanup.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A([Push / Pull Request]) --> B[Install Dependencies]
    B --> C[Format Check\npnpm run format:check\noxfmt --check .]
    C -->|pass| D[Lint\npnpm run lint\noxlint]
    D -->|pass| E[Build\npnpm run build]
    E --> F[Test\npnpm run test:coverage]
    C -->|fail| X1([❌ CI Fails])
    D -->|fail| X2([❌ CI Fails])
    E -->|fail| X3([❌ CI Fails])
    F -->|fail| X4([❌ CI Fails])
    F -->|pass| G([✅ CI Passes])
Loading

Last reviewed commit: 4669f6e

pnpm install

- name: Prettier
- name: Format
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally, I would split these out into a separate lint.yml, so that the two concerns (bad formatting, failed tests) don't interfere.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants