Skip to content

Guide · Open source

How to use oxc: lint and format JavaScript with Oxlint and Oxfmt

Updated · written with AI from the project's own documentation and checked against our catalogue data

Oxc is a collection of high-performance tools for JavaScript and TypeScript, written in Rust. It includes a linter called Oxlint, a formatter called Oxfmt, and building blocks such as a parser, transformer, minifier and module resolver. This guide shows you how to run the linter and formatter on a codebase and what the other pieces are for, so you can decide whether it fits your project.

Oxcoxc-project/oxc · ★ 23.3k · MIT

Quick start

  1. 1Open a terminal in your project. Change into the root folder of the JavaScript or TypeScript project you want to check.
  2. 2Run the linter. Run npx oxlint@latest to lint the codebase.
  3. 3Read the output. Fix the reported issues, or check the Oxlint guide at oxc.rs/docs/guide/usage/linter for options.
  4. 4Run the formatter. Run npx oxfmt@latest to format the codebase.
  5. 5Check the result. Review the formatted changes in your version control before committing.

What is Oxc and what is it made of?

Oxc describes itself as the Oxidation Compiler, a collection of high-performance tools for JavaScript and TypeScript written in Rust. It is part of VoidZero's vision for a unified toolchain for JavaScript.

The project powers Rolldown, the bundler used by Vite, and the README says it is designed for speed.

  • Oxlint: linter
  • Oxfmt: formatter
  • Parser, transformer, minifier and resolver: building blocks for build tooling

Lint a codebase with Oxlint

Oxlint is the linter in the Oxc collection. The README gives a single command to run it through npx, which fetches the latest published version without a separate global install.

Run the command from the root of your project. Full usage options are in the Oxlint guide linked from the README at oxc.rs/docs/guide/usage/linter.

npx oxlint@latest

Format a codebase with Oxfmt

Oxfmt is the formatter in the Oxc collection. As with the linter, the README shows a single npx command to run it.

Formatter configuration and options are described in the Oxfmt guide at oxc.rs/docs/guide/usage/formatter.

npx oxfmt@latest

Use the parser, transformer, minifier and resolver

If you are building your own JavaScript tooling, Oxc also exposes lower-level pieces. The README lists four: a parser for JavaScript and TypeScript, a transformer for TypeScript, JSX and modern JavaScript, a minifier for production builds, and a resolver for modules.

Each has its own page in the Oxc docs. The README does not give code examples for these, so read those pages before wiring them in.

  • Parser: oxc.rs/docs/guide/usage/parser
  • Transformer: oxc.rs/docs/guide/usage/transformer
  • Minifier: oxc.rs/docs/guide/usage/minifier
  • Resolver: oxc.rs/docs/guide/usage/resolver

Check the troubleshooting and benchmark pages

The README links to a troubleshooting page and a benchmarks page on the Oxc website. Check the troubleshooting page first if a command fails. The README itself does not list specific errors or fixes.

Benchmarks are on the website too. Read them as the project's own claims about speed.

  • Troubleshooting: oxc.rs/docs/guide/troubleshooting
  • Benchmarks: oxc.rs/docs/guide/benchmarks

What people use it for

  • Linting a JavaScript or TypeScript project quickly from the command line
  • Formatting a codebase with a single npx command
  • Building custom JavaScript tooling on the Oxc parser or resolver
  • Checking code in a project that already uses Vite or Rolldown

Frequently asked questions

Is Oxc free to use?

Yes. The README says Oxc is free and open-source software licensed under the MIT License. Some ported code is under other licences, listed in the project's third-party licence file.

What do I need installed to use Oxc?

The README lists no prerequisites. The lint and format commands use npx, so you will need a working Node.js and npm setup to run them, which the README does not spell out.

Is Oxc an alternative to ESLint, Prettier or Biome?

Oxc is often compared with ESLint, Biome, Prettier and SWC. Oxlint is the linter and Oxfmt the formatter. The README does not include a feature comparison, so check each tool's docs against your needs.

Can I use Oxc with Vite?

Oxc is used by Rolldown, which the README describes as Vite's bundler. The README does not describe a direct Vite plugin, so check the Oxc docs for integration details.

Why does the command use npx and @latest?

npx runs a package without a permanent global install. The @latest tag asks for the newest published version. Pin a specific version in your own setup if you need reproducible results.

Where do I get help if something breaks?

Use the troubleshooting page at oxc.rs/docs/guide/troubleshooting, or ask on the project's Discord, linked from the README.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Oxc suits developers who want a fast linter and formatter for JavaScript or TypeScript, and teams building their own build tooling who need a parser or resolver. Skip it if you need a long-established plugin ecosystem or detailed feature documentation, since the README does not describe either.

Install options & downloads