From 85330ef2b04bb0f4074d6cf21d31559a95bf40e6 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Wed, 26 Mar 2025 02:48:14 +0800 Subject: [PATCH] chore: better oxlint + vscode integration (#720) * chore: add oxlint to file nesting patterns While only `.oxlintrc.json` is the only official configuration file, I found [4 file name patterns](https://github.com/oxc-project/oxc/blob/2c53a728b0128290260e3ce676e25a2a0d94ff56/editors/vscode/package.json#L118-L123) in its vscode extension. So I added them all to the file nesting patterns. * feat: recommend oxc vscode extension when oxlint is chosen --- index.ts | 4 ++++ template/base/.vscode/settings.json | 2 +- template/config/oxlint/.vscode/extensions.json | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 template/config/oxlint/.vscode/extensions.json diff --git a/index.ts b/index.ts index 67e8d75b..26fe68d4 100755 --- a/index.ts +++ b/index.ts @@ -488,6 +488,10 @@ async function init() { render('config/eslint') } + if (needsOxlint) { + render('config/oxlint') + } + if (needsPrettier) { render('config/prettier') } diff --git a/template/base/.vscode/settings.json b/template/base/.vscode/settings.json index 985128aa..5070dee4 100644 --- a/template/base/.vscode/settings.json +++ b/template/base/.vscode/settings.json @@ -3,6 +3,6 @@ "explorer.fileNesting.patterns": { "tsconfig.json": "tsconfig.*.json, env.d.ts", "vite.config.*": "jsconfig*, vitest.config.*, cypress.config.*, playwright.config.*", - "package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .prettier*, prettier*, .editorconfig" + "package.json": "package-lock.json, pnpm*, .yarnrc*, yarn*, .eslint*, eslint*, .oxlint*, oxlint*, .prettier*, prettier*, .editorconfig" } } diff --git a/template/config/oxlint/.vscode/extensions.json b/template/config/oxlint/.vscode/extensions.json new file mode 100644 index 00000000..99e2f7dd --- /dev/null +++ b/template/config/oxlint/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["oxc.oxc-vscode"] +} -- 2.39.5