From 34276b58559967f48dd2b29c663eaa7abe45d641 Mon Sep 17 00:00:00 2001 From: pany <939630029@qq.com> Date: Wed, 21 Feb 2024 13:34:50 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20prettier=20=E7=BB=A7=E6=89=BF=20.edito?= =?UTF-8?q?rconfig=20=E7=9A=84=E7=BC=A9=E8=BF=9B=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 5 +++-- .vscode/settings.json | 1 - prettier.config.js | 7 ++----- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3396d2fe..d22b4722 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,4 @@ +# 修改配置后重启编辑器 # 配置项文档:https://editorconfig.org/ # 告知 EditorConfig 插件,当前即是根文件 @@ -7,9 +8,9 @@ root = true [*] ## 设置字符集 charset = utf-8 -## 缩进风格 space | tab,建议 space +## 缩进风格 space | tab,建议 space(会自动继承给 Prettier) indent_style = space -## 缩进的空格数(修改这里的话需要将 prettier.config.js 和 .vscode -> settings.json 也同步修改) +## 缩进的空格数(会自动继承给 Prettier) indent_size = 2 ## 换行符类型 lf | cr | crlf,一般都是设置为 lf end_of_line = lf diff --git a/.vscode/settings.json b/.vscode/settings.json index 98be56ff..64247330 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,4 @@ { - "editor.tabSize": 2, "editor.codeActionsOnSave": { "source.fixAll.eslint": "explicit" }, diff --git a/prettier.config.js b/prettier.config.js index 5138725e..ebbcd5fc 100644 --- a/prettier.config.js +++ b/prettier.config.js @@ -1,4 +1,5 @@ /** + * 修改配置后重启编辑器 * 配置项文档:https://prettier.io/docs/en/configuration.html * @type {import("prettier").Config} */ @@ -6,8 +7,6 @@ export default { /** 每一行的宽度 */ printWidth: 120, - /** Tab 键的空格数 */ - tabWidth: 2, /** 在对象中的括号之间是否用空格来间隔 */ bracketSpacing: true, /** 箭头函数的参数无论有几个,都要括号包裹 */ @@ -19,7 +18,5 @@ export default { /** 对象或者数组的最后一个元素后面不要加逗号 */ trailingComma: "none", /** 是否加分号 */ - semi: false, - /** 是否使用 Tab 格式化 */ - useTabs: false + semi: false }