From 305ac6dccdca57e6b096891c3ffdbfb8ddd415c7 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Fri, 13 Jun 2025 17:28:51 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0oxlint=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=B9=B6=E6=9B=B4=E6=96=B0prettier=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加.oxlintrc.json配置文件以启用oxlint检查,并更新.prettierrc.cjs以支持jsonc文件格式。同时在useUpload.ts中恢复accept参数的默认值。 --- .oxlintrc.json | 11 +++++++++++ .prettierrc.cjs | 2 +- src/hooks/useUpload.ts | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 .oxlintrc.json diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 0000000..fd48a0e --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,11 @@ +{ + "extends": ["@oxlint/recommended"], + "rules": { + "no-console": "off", + "no-unused-vars": "off" + }, + "files": ["src/**/*.{js,ts,vue}"], + "vue": { + "enabled": true + } +} diff --git a/.prettierrc.cjs b/.prettierrc.cjs index 3986355..448279e 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -10,7 +10,7 @@ module.exports = { htmlWhitespaceSensitivity: 'ignore', overrides: [ { - files: '*.json', + files: '*.{json,jsonc}', options: { trailingComma: 'none', }, diff --git a/src/hooks/useUpload.ts b/src/hooks/useUpload.ts index d0936de..a3edb3b 100644 --- a/src/hooks/useUpload.ts +++ b/src/hooks/useUpload.ts @@ -20,7 +20,7 @@ export default function useUpload(options: TOptions = {} const { formData = {}, maxSize = 5 * 1024 * 1024, - // accept = ['*'], + accept = ['*'], fileType = 'image', success, error: onError,