Skip to content

Commit cfaba5d

Browse files
committed
feat: use @prettier/plugin-oxc when user selects Oxlint and Prettier
Closes #76
1 parent c00d619 commit cfaba5d

File tree

4 files changed

+238
-1
lines changed

4 files changed

+238
-1
lines changed

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ export default function createConfig({
8181
pkg.scripts.format = 'prettier --write src/'
8282
}
8383

84+
if (needsOxlint && needsPrettier) {
85+
additionalConfigs.push({
86+
devDependencies: pickDependencies(['@prettier/plugin-oxc']),
87+
})
88+
}
89+
8490
const configsBeforeVuePlugin = [],
8591
configsAfterVuePlugin = []
8692
for (const config of additionalConfigs) {
@@ -91,6 +97,7 @@ export default function createConfig({
9197

9298
const templateData = {
9399
styleGuide,
100+
needsOxlint,
94101
needsPrettier,
95102
fileExtensions,
96103
configsBeforeVuePlugin,

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
},
4141
"devDependencies": {
4242
"@eslint/js": "^9.31.0",
43+
"@prettier/plugin-oxc": "^0.0.4",
4344
"@types/node": "^22.16.5",
4445
"@vue/eslint-config-prettier": "^10.2.0",
4546
"@vue/eslint-config-typescript": "^14.6.0",

pnpm-lock.yaml

Lines changed: 225 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/_prettierrc.json.ejs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@
66
"$schema": "https://json.schemastore.org/prettierrc",
77
"semi": false,
88
"singleQuote": true,
9-
"printWidth": 100
9+
"printWidth": 100<%_ if (needsOxlint) { _%>,
10+
"plugins": [
11+
"@prettier/plugin-oxc"
12+
]
13+
<%_ } _%>
1014
}

0 commit comments

Comments
 (0)