Skip to content

Commit 37c4dcb

Browse files
authored
feat: add experimental oxlint support (#33)
Closes #31
1 parent 086bdba commit 37c4dcb

File tree

4 files changed

+122
-0
lines changed

4 files changed

+122
-0
lines changed

bin/create-eslint-config.js

+9
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,19 @@ const { needsPrettier } = await prompt({
176176
message: 'Do you need Prettier to format your code?'
177177
})
178178

179+
const { needsOxlint } = await prompt({
180+
type: 'toggle',
181+
disabled: 'No',
182+
enabled: 'Yes',
183+
name: 'needsOxlint',
184+
message: 'Would you like to supplement ESLint with Oxlint for faster linting (experimental)?'
185+
})
186+
179187
const { pkg: pkgToExtend, files } = createConfig({
180188
hasTypeScript,
181189
supportedScriptLangs,
182190
needsPrettier,
191+
needsOxlint,
183192
})
184193

185194
// TODO:

index.js

+13
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default function createConfig({
1010

1111
hasTypeScript = false,
1212
needsPrettier = false,
13+
needsOxlint = false,
1314

1415
additionalConfigs = [],
1516
}) {
@@ -51,6 +52,18 @@ export default function createConfig({
5152
})
5253
}
5354

55+
if (needsOxlint) {
56+
additionalConfigs.push({
57+
devDependencies: pickDependencies(['oxlint', 'eslint-plugin-oxlint']),
58+
afterVuePlugin: [
59+
{
60+
importer: "import oxlint from 'eslint-plugin-oxlint'",
61+
content: "oxlint.configs['flat/recommended'],",
62+
},
63+
],
64+
})
65+
}
66+
5467
if (needsPrettier) {
5568
additionalConfigs.push({
5669
devDependencies: pickDependencies([

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@
4343
"@vue/eslint-config-prettier": "^10.1.0",
4444
"@vue/eslint-config-typescript": "^14.1.3",
4545
"eslint": "^9.13.0",
46+
"eslint-plugin-oxlint": "^0.11.0",
4647
"eslint-plugin-vue": "^9.30.0",
48+
"oxlint": "^0.11.0",
4749
"prettier": "^3.3.3",
4850
"typescript": "~5.6.0"
4951
}

pnpm-lock.yaml

+98
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)