Skip to content

Migrate to oxlint and oxfmt#696

Draft
7w1 wants to merge 14 commits intodevfrom
migrate-oxlint-oxfmt
Draft

Migrate to oxlint and oxfmt#696
7w1 wants to merge 14 commits intodevfrom
migrate-oxlint-oxfmt

Conversation

@7w1
Copy link
Copy Markdown
Member

@7w1 7w1 commented Apr 17, 2026

Description

Migrates from eslint and prettier to oxlint and oxfmt + some rule hardening and - some rules that don't exist in oxlint, but I decided it probably wasn't worth running both in parallel just for a few rules.

Notably, got rid of many "as any"s and swapped to .toSorted() for safer stuff and "type" in imports. Added comments to all the existing lint issues (console logging and the alert for app updates) and the few places "as any" was justified (test cases) and some message object whatnots.

Also notably, fmt now takes a second or two, and linting now takes no more than a few seconds. Yay!

Recommended vscode plugins, workflows, and configs should all be updated assuming I didn't miss anything.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change - breaking I guess since not all rules exist? I don't really know exactly what I uh... didn't include.
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

I deployed a swarm of silly AIs to fix many of the simpler as any casts and subsequent typechecks because there were hundreds and I'm not doing that manually :p. I did review it, mostly just seamless swapping to the correct cast type instead of as any, nothing particularly complicated.

ran formatter
fixed lint issues, primarily getting rid of "any"s and swapping to .toSorted()
@7w1 7w1 requested a review from hazre as a code owner April 17, 2026 03:31
@7w1 7w1 added the internal label Apr 17, 2026
@7w1 7w1 marked this pull request as draft April 17, 2026 03:36
@nushea
Copy link
Copy Markdown
Contributor

nushea commented Apr 17, 2026

read it partially buton the train on my phone the code lgtm for the parts I was concerned about

@7w1 7w1 marked this pull request as ready for review April 17, 2026 05:39
Copy link
Copy Markdown
Member

@hazre hazre left a comment

Choose a reason for hiding this comment

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

Oh nice, I was actually going to do this in #607.

Few things, I think we should use the *.config.ts format instead of json, since it's more flexible.
https://oxc.rs/docs/guide/usage/linter/config.html#typescript-config-file-oxlint-config-ts
https://oxc.rs/docs/guide/usage/formatter/config.html#create-a-config-file

Also move fix.py to scripts and ideally rewrite in js and rename it to be less generic.

Comment thread .oxlintrc.json Outdated
@7w1 7w1 marked this pull request as draft April 17, 2026 14:59
Copy link
Copy Markdown
Member

@hazre hazre left a comment

Choose a reason for hiding this comment

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

Looks good. Any chance you could also setup these:
https://oxc.rs/docs/guide/usage/linter/editors.html#team-setup
https://oxc.rs/docs/guide/usage/formatter/editors.html#team-setup

for automatic linting and formatting on save?

also could you remove stale eslint comments or replace them with oxlint ones?

for consistency sakes swapping oxfmt to config.ts would be nice too.

@github-actions
Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

Status Preview URL Commit Alias Updated (UTC)
✅ Deployment successful! https://pr-696-sable.raspy-dream-bb1d.workers.dev fed60b4 pr-696 Sun, 19 Apr 2026 15:06:46 GMT

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.

3 participants