From 69643dbc8336ef802a596e106806128832976d41 Mon Sep 17 00:00:00 2001 From: zhangyahui Date: Thu, 5 Feb 2026 10:07:39 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20prettier=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierrc.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .prettierrc.js diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..cf9b8f56 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,33 @@ +/** @type {import('prettier').Config} */ +module.exports = { + // 打印宽度 + printWidth: 100, + // 使用 4 空格缩进 + tabWidth: 4, + // 使用 4 空格缩进,不使用制表符 + useTabs: true, + // 行尾使用 LF (Unix 风格) + endOfLine: 'lf', + // 语句末尾使用分号 + semi: false, + // 使用单引号 + singleQuote: false, + // 对象和数组末尾不添加尾随逗号 + trailingComma: 'none', + // JSX 引号使用单引号 + jsxSingleQuote: false, + // 括号内侧空格 + bracketSpacing: true, + // JSX 标签不换行 + bracketSameLine: false, + // 箭头函数参数始终使用括号 + arrowParens: 'always', + // HTML、Vue、Angular 和 Markdown 使用 LF + htmlWhitespaceSensitivity: 'css', + // Vue 文件脚本和样式缩进 + vueIndentScriptAndStyle: false, + // 行注释位置在注释上方,不加空格 + proseWrap: 'preserve', + // 根据文件类型自动推断 + embeddedLanguageFormatting: 'auto', +}; \ No newline at end of file