From ed0527bf27d710d70e09a1f21d7a6906e1cdd85b Mon Sep 17 00:00:00 2001 From: Azure <983547216@qq.com> Date: Sun, 28 Sep 2025 14:51:32 +0800 Subject: [PATCH] 1 --- .prettierrc.json | 13 +------------ PRETTIER_CONFIG_GUIDE.md | 37 +++++++++++++++++++++++++++++++++++-- src/main.ts | 2 +- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/.prettierrc.json b/.prettierrc.json index 2bdca84..d7bf21d 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -3,16 +3,5 @@ "semi": false, "singleQuote": true, "printWidth": 100, - "useTabs": false, - "tabWidth": 2, - "bracketSpacing": true, - "bracketSameLine": false, - "jsxSingleQuote": false, - "trailingComma": "es5", - "arrowParens": "always", - "endOfLine": "lf", - "quoteProps": "as-needed", - "htmlWhitespaceSensitivity": "css", - "vueIndentScriptAndStyle": false, - "singleAttributePerLine": false + "trailingComma": "none" } diff --git a/PRETTIER_CONFIG_GUIDE.md b/PRETTIER_CONFIG_GUIDE.md index bdb37c2..857c117 100644 --- a/PRETTIER_CONFIG_GUIDE.md +++ b/PRETTIER_CONFIG_GUIDE.md @@ -83,7 +83,16 @@ ### singleAttributePerLine (boolean) - **默认值**: false -- **说明**: 是否强制每个 JSX 属性独占一行 +- **说明**: 强制每个 HTML、Vue 和 JSX 属性独占一行 +- **示例**: + + ```html + + + + + + ``` ## 函数和箭头函数 @@ -127,8 +136,32 @@ - **默认值**: "css" - **可选值**: "css" | "strict" | "ignore" - **说明**: 指定 HTML、Vue、Angular 文件中全局空白敏感度 + - "css": 尊重 CSS display 属性的默认值 + - "strict": 所有空白都被认为是重要的 + - "ignore": 所有空白都被认为是不重要的 ### vueIndentScriptAndStyle (boolean) - **默认值**: false -- **说明**: Vue 文件中单文件组件的脚本和样式标签内是否缩进 +- **说明**: Vue 文件中单文件组件的 `