Skip to content

Commit a51b6e9

Browse files
committed
chore: use oxlint and oxfmt directly to avoid vite-plus bug
Due to a bug in vite-plus, every vite-plus command runs postinstall, consequently taking much longer than anticipated. The outcome of this is that commands like `pnpm lint` and perhaps even worse, `git commit` are about 4.5 seconds slower than they could. This PR fixes that by directly calling oxlint and oxfmt, circumventing the issue.
1 parent 306d537 commit a51b6e9

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
"i18n:check:fix": "node scripts/compare-translations.ts --fix",
1919
"knip": "knip",
2020
"knip:fix": "knip --fix",
21-
"lint": "vite lint && vite fmt --check",
22-
"lint:fix": "vite lint --fix && vite fmt",
21+
"lint": "oxlint && oxfmt --check",
22+
"lint:fix": "oxlint --fix && oxfmt",
2323
"generate": "nuxt generate",
2424
"npmx-connector": "pnpm --filter npmx-connector dev",
2525
"generate-pwa-icons": "pwa-assets-generator",
@@ -108,6 +108,8 @@
108108
"fast-npm-meta": "1.0.0",
109109
"knip": "5.82.1",
110110
"lint-staged": "16.2.7",
111+
"oxfmt": "0.27.0",
112+
"oxlint": "1.42.0",
111113
"playwright-core": "1.58.0",
112114
"schema-dts": "1.1.5",
113115
"simple-git-hooks": "2.13.1",
@@ -125,14 +127,14 @@
125127
"lint-staged": {
126128
"i18n/locales/*": [
127129
"pnpm build:lunaria",
128-
"vite fmt lunaria/files/",
130+
"pnpm oxfmt lunaria/files/",
129131
"git add lunaria/files/"
130132
],
131133
"*.{js,ts,mjs,cjs,vue}": [
132-
"vite lint --fix"
134+
"pnpm oxlint --fix"
133135
],
134136
"*.{js,ts,mjs,cjs,vue,json,yml,md,html,css}": [
135-
"vite fmt"
137+
"pnpm oxfmt"
136138
]
137139
},
138140
"packageManager": "pnpm@10.28.2"

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)