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 }