From 9494f8fda6d00c766b181081e91ff326d745ac48 Mon Sep 17 00:00:00 2001 From: LittleTurtle2333 Date: Mon, 23 Jun 2025 11:39:29 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=BC=95=E5=85=A5eslint-plugin-format?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=EF=BC=8C=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84Prettier=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierignore | 14 ------- .prettierrc.cjs | 19 ---------- eslint.config.mjs | 21 +++++++++++ package.json | 2 +- pnpm-lock.yaml | 94 +++++++++++++++++++++++++++++++++++++++++------ 5 files changed, 105 insertions(+), 45 deletions(-) delete mode 100644 .prettierignore delete mode 100644 .prettierrc.cjs diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 77134df..0000000 --- a/.prettierignore +++ /dev/null @@ -1,14 +0,0 @@ -node_modules - -# unplugin-auto-import 生成的类型文件,每次提交都改变,所以加入这里吧,与 .gitignore 配合使用 -auto-import.d.ts - -# vite-plugin-uni-pages 生成的类型文件,每次切换分支都一堆不同的,所以直接 .gitignore -uni-pages.d.ts - -# 插件生成的文件 -src/pages.json -src/manifest.json - -# 忽略自动生成文件 -src/service/app/** diff --git a/.prettierrc.cjs b/.prettierrc.cjs deleted file mode 100644 index 448279e..0000000 --- a/.prettierrc.cjs +++ /dev/null @@ -1,19 +0,0 @@ -// @see https://prettier.io/docs/en/options -module.exports = { - singleQuote: true, - printWidth: 100, - tabWidth: 2, - useTabs: false, - semi: false, - trailingComma: 'all', - endOfLine: 'auto', - htmlWhitespaceSensitivity: 'ignore', - overrides: [ - { - files: '*.{json,jsonc}', - options: { - trailingComma: 'none', - }, - }, - ], -} diff --git a/eslint.config.mjs b/eslint.config.mjs index a624835..54ce246 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -7,6 +7,15 @@ export default uniHelper({ ignores: [ 'src/uni_modules/', 'dist', + // unplugin-auto-import 生成的类型文件,每次提交都改变,所以加入这里吧,与 .gitignore 配合使用 + 'auto-import.d.ts', + // vite-plugin-uni-pages 生成的类型文件,每次切换分支都一堆不同的,所以直接 .gitignore + 'uni-pages.d.ts', + // 插件生成的文件 + 'src/pages.json', + 'src/manifest.json', + // 忽略自动生成文件 + 'src/service/app/**', ], rules: { 'no-console': 'off', @@ -19,4 +28,16 @@ export default uniHelper({ 'ts/no-empty-object-type': 'off', 'no-extend-native': 'off', }, + formatters: { + /** + * Format CSS, LESS, SCSS files, also the `