Skip to content

Instantly share code, notes, and snippets.

@connorshea
Last active November 9, 2025 22:08
Show Gist options
  • Select an option

  • Save connorshea/9eb33c4e1efbf153d4adbe90cad5bfed to your computer and use it in GitHub Desktop.

Select an option

Save connorshea/9eb33c4e1efbf153d4adbe90cad5bfed to your computer and use it in GitHub Desktop.
Testing oxlint patches using mastodon.

How to test oxlint patches in the mastodon repo.

NOTE: This assumes you have oxc and mastodon cloned into the ~/code directory specifically, adjust the directions accordingly for whatever directory you store your git repositories.

Setup:

  • Clone oxc and mastodon repos locally.
    • git clone https://github.com/mastodon/mastodon
    • git clone https://github.com/oxc-project/oxc
  • Set up oxc to be able to build it locally with Rust, etc. (see oxc docs)
  • In the root of the mastodon repo, create a directory oxlint-dist/ to hold the built oxc files.
  • Add oxlint-dist/ to the .gitignore file in the mastodon repo.
  • You will want/need to generate an .oxlintrc.json for mastodon if you didn't add one already/have one to test.
    • You can convert the existing eslint config they have using @oxlint/migrate
    • You can use the one from this branch, which is generated with oxlint v1.26.0 with the migration tool (jsPlugins disabled, type aware rules disabled, and all migrated 'warn'-level rules set to 'off' since they just add noise)
  • If you want to compare against the ESLint results for a lint run on the repo:
    • yarn install to install dependencies
    • yarn run lint:js will run the ESLint lints, you may need to add oxlint-dist/ to the ignorePatterns in the eslint config.

Testing a patch:

  • If you have already done this before, you may want to delete the contents of the oxlint-dist directory in mastodon to ensure a clean build.
  • In the oxc repo:
    • Go to apps/oxlint/.
    • Run pnpm run build-dev to generate the oxlint CLI.
    • Copy the dist/ you've just built over to mastodon: cp -R dist/ ~/code/mastodon/oxlint-dist/
  • In the mastodon repo:
    • Run oxlint with your locally-build patch: node dist/cli.js -c .oxlintrc.json
    • Review the output and see if your patch is working as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment