From a358340e2dc14dd9dff6f7715c4d457638a1f83b Mon Sep 17 00:00:00 2001 From: ErSan Date: Sun, 28 Dec 2025 21:40:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(prettier):=20=E6=B7=BB=E5=8A=A0=20Prettier?= =?UTF-8?q?=20=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E4=BB=A5=E8=A7=84?= =?UTF-8?q?=E8=8C=83=E5=8C=96=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierrc.js | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 51 ++++++++++++++++++++++++++------------------------ 2 files changed, 76 insertions(+), 24 deletions(-) create mode 100644 .prettierrc.js diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..02c0c4a --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,49 @@ +/** @type {import("prettier").Config} */ +module.exports = { + // 一行最多160字符 + printWidth: 160, + // 指定一个制表符等于的空格数 + tabWidth: 4, + // 使用制表符,而不使用空格 + useTabs: true, + // 行尾需要有分号 + semi: true, + // 使用单引号代替双引号 + singleQuote: false, + // 默认值。因为使用了一些折行敏感型的渲染器(如GitHub comment)而按照markdown文本样式进行折行 + proseWrap: "preserve", + // 对象的key仅在必要时用引号括起来 + quoteProps: "as-needed", + // 尾逗号根据ES5规则使用 + trailingComma: "es5", + // 在对象,数组括号与文字之间加空格 "{ foo: bar }" + bracketSpacing: true, + // (x) => {} 箭头函数参数只有一个时是否要有小括号。avoid:省略括号 + arrowParens: "avoid", + // 指定 HTML 文件的空白字符敏感度 + htmlWhitespaceSensitivity: "ignore", + // 缩进 Vue SFC 文件中的