Skip to content

chore: migrate to oxlint#17596

Closed
Rich-Harris wants to merge 11 commits into
mainfrom
oxlint
Closed

chore: migrate to oxlint#17596
Rich-Harris wants to merge 11 commits into
mainfrom
oxlint

Conversation

@Rich-Harris

Copy link
Copy Markdown
Member

This isn't ready for prime-time but I figured I'd try and see what would be involved in migrating. After installing oxlint I ran this command to generate the .oxlintrc.json:

npx @oxlint/migrate --with-nursery --js-plugins --type-aware

pnpm oxlint then failed with

Failed to load JS plugin: eslint-plugin-custom

so I installed it, then

Failed to load JS plugin: @stylistic/eslint-plugin

so I installed it, then

Rule 'no_compiler_imports' not found in plugin 'custom'

and at that point I tapped out

@changeset-bot

changeset-bot Bot commented Jan 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6ef7239

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@17596

@connorshea

Copy link
Copy Markdown

Oh, yeah @oxlint/migrate can't handle a rule defined inside the eslint.config.js like it is. There's no way for us to really unless we automatically migrate the code into its own file, which would get messy. If that no_compiler_imports rule were moved into its own file before trying the migration, it should work?

@Rich-Harris
Rich-Harris temporarily deployed to Publish pkg.pr.new (maintainers) February 6, 2026 19:41 — with GitHub Actions Inactive
@svelte-docs-bot

Copy link
Copy Markdown

@Rich-Harris
Rich-Harris temporarily deployed to Publish pkg.pr.new (maintainers) February 6, 2026 19:49 — with GitHub Actions Inactive
@Rich-Harris

Copy link
Copy Markdown
Member Author

Thanks for the pointer! Got it working now.


There are a few plugins we use that aren't currently supported:

  • no-dupe-args
  • no-octal
  • no-restricted-properties
  • prefer-arrow-callback
  • n/prefer-global/process
  • n/prefer-node-protocol

I don't think these are reason enough by themselves not to migrate, but worth flagging.

I needed to add one ignore comment that I don't totally understand — Eslint is okay with this...

/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u

...but Oxlint isn't.

Other than that:

  • linting is (predictably) much faster now
  • we can't get remove eslint from our dependency tree yet because it's a peer dependency of various plugins we're currently using

@Rich-Harris
Rich-Harris marked this pull request as ready for review February 6, 2026 20:13
Comment thread .oxlintrc.json
* remove defautls

* format

* format abc
@Rich-Harris
Rich-Harris temporarily deployed to Publish pkg.pr.new (maintainers) February 6, 2026 22:18 — with GitHub Actions Inactive
Comment thread .oxlintrc.json
"svelte/system": "error",
"svelte/valid-each-key": "error",
"svelte/valid-prop-names-in-kit-pages": "error",
"unicorn/no-await-in-promise-methods": "off",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These weren't mentioned in the eslint.config.js. Perhaps they don't work in oxlint and that's why they're disabled here? Maybe add a TODO to re-enable them?

Comment thread .oxlintrc.json
"no-unreachable": "error",
"no-unused-vars": "off",
"no-useless-rename": "off",
"svelte/comment-directive": "error",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm guessing these come from plugin:svelte/recommended? Maybe we could just set that instead?

Comment thread package.json
"eslint-plugin-lube": "^0.4.3",
"eslint-plugin-svelte": "^3.11.0",
"jsdom": "25.0.1",
"oxlint": "^1.42.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@benmccann

Copy link
Copy Markdown
Member

no-dupe-args

It looks like this won't be implemented and is superseded by strict mode: oxc-project/oxc#479

no-octal

It looks like this won't be implemented and is superseded by strict mode: oxc-project/oxc#479

n/prefer-node-protocol

It looks like this won't be implemented and we should switch to unicorn/prefer-node-protocol: oxc-project/oxc#493

@benmccann
benmccann temporarily deployed to Publish pkg.pr.new (maintainers) February 7, 2026 16:25 — with GitHub Actions Inactive
@benmccann

benmccann commented Feb 7, 2026

Copy link
Copy Markdown
Member

It looks like the .oxlintrc.json isn't extending @sveltejs/eslint-config the way ‎eslint.config.js was. We should probably migrate the base config first and then extend from that

The migration tool seems to have made it a bit hard to follow things. I wonder if it might be easier to just start from scratch and manually migrate

@connorshea

Copy link
Copy Markdown

I needed to add one ignore comment that I don't totally understand — Eslint is okay with this...

/^(?:\p{Lu}[$\u200c\u200d\p{ID_Continue}.]*|\p{ID_Start}[$\u200c\u200d\p{ID_Continue}]*(?:\.[$\u200c\u200d\p{ID_Continue}]+)+)$/u

...but Oxlint isn't.

This is fixed in main now, will be released on Monday 🫡

@benmccann benmccann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm super eager to migrate, but personally I'm not sure it's time yet

Digging into this there seems to be a few big issues we're hitting:

And while not a blocker for this repo specifically, quite a number of community projects will be blocked by the lack of TypeScript support in .svelte files: oxc-project/oxc#14826 (comment)

I'd personally close the PR and file a tracking issue linking to those issues. I can't wait though 😄

@Rich-Harris

Copy link
Copy Markdown
Member Author

#17665

@Rich-Harris Rich-Harris closed this Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants