2025-05-27 09:35:31 +08:00
|
|
|
# @prettier/plugin-oxc
|
|
|
|
|
|
2025-05-29 15:30:45 +08:00
|
|
|
> Prettier [Oxc](https://oxc.rs/) plugin.
|
2025-05-27 09:35:31 +08:00
|
|
|
|
|
|
|
|
## Install
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
yarn add --dev prettier @prettier/plugin-oxc
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
Create or modify your [prettier configuration file](https://prettier.io/docs/en/configuration) to use the plugin:
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"overrides": [
|
|
|
|
|
{
|
2025-05-27 13:32:23 +08:00
|
|
|
"files": ["**/*.{js,mjs,cjs,jsx}"],
|
2025-05-27 09:35:31 +08:00
|
|
|
"options": {
|
|
|
|
|
"plugins": ["@prettier/plugin-oxc"],
|
|
|
|
|
"parser": "oxc"
|
|
|
|
|
}
|
2025-05-27 13:32:23 +08:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"files": ["**/*.{ts,mts,cts,tsx}"],
|
|
|
|
|
"options": {
|
|
|
|
|
"plugins": ["@prettier/plugin-oxc"],
|
|
|
|
|
"parser": "oxc-ts"
|
|
|
|
|
}
|
2025-05-27 09:35:31 +08:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
```
|