Use oxc as a Prettier parser for faster JavaScript and TypeScript formatting. Current stable version 0.2.0 (April 2025) requires Prettier >= 3.6.2. Releases are based on oxc-parser major updates. Differentiators: faster than default Prettier parsers for large TS projects, supports raw transfer on Node >= 22 for near-zero AST copy cost, and handles decorators in JS files since v0.2.0. Alternative to @prettier/plugin-oxc with better performance due to synchronous API and raw transfer.
npm install prettier-oxc-parserVerified import paths — ran on the pinned version, not inferred.
Install the plugin, add to Prettier config, then format files using Prettier CLI or API with the plugin loaded.
Upgrade Prettier to 3.6.2 or higher.
Use Node 22+ for maximum speed, or fall back to normal transfer.
Do not use with Flow-typed files; stick to default Prettier parser for those.
Upgrade to 0.2.0 which bumps oxc-parser to 0.77.2.
Run npm install -D prettier-oxc-parser
npm install -D prettier@latest
Use import { format } from 'prettier' or dynamic import().