chore: prettier 继承 .editorconfig 的缩进风格
This commit is contained in:
parent
bf9d6eb7b6
commit
34276b5855
@ -1,3 +1,4 @@
|
|||||||
|
# 修改配置后重启编辑器
|
||||||
# 配置项文档:https://editorconfig.org/
|
# 配置项文档:https://editorconfig.org/
|
||||||
|
|
||||||
# 告知 EditorConfig 插件,当前即是根文件
|
# 告知 EditorConfig 插件,当前即是根文件
|
||||||
@ -7,9 +8,9 @@ root = true
|
|||||||
[*]
|
[*]
|
||||||
## 设置字符集
|
## 设置字符集
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
## 缩进风格 space | tab,建议 space
|
## 缩进风格 space | tab,建议 space(会自动继承给 Prettier)
|
||||||
indent_style = space
|
indent_style = space
|
||||||
## 缩进的空格数(修改这里的话需要将 prettier.config.js 和 .vscode -> settings.json 也同步修改)
|
## 缩进的空格数(会自动继承给 Prettier)
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
## 换行符类型 lf | cr | crlf,一般都是设置为 lf
|
## 换行符类型 lf | cr | crlf,一般都是设置为 lf
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
|
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -1,5 +1,4 @@
|
|||||||
{
|
{
|
||||||
"editor.tabSize": 2,
|
|
||||||
"editor.codeActionsOnSave": {
|
"editor.codeActionsOnSave": {
|
||||||
"source.fixAll.eslint": "explicit"
|
"source.fixAll.eslint": "explicit"
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
|
* 修改配置后重启编辑器
|
||||||
* 配置项文档:https://prettier.io/docs/en/configuration.html
|
* 配置项文档:https://prettier.io/docs/en/configuration.html
|
||||||
* @type {import("prettier").Config}
|
* @type {import("prettier").Config}
|
||||||
*/
|
*/
|
||||||
@ -6,8 +7,6 @@
|
|||||||
export default {
|
export default {
|
||||||
/** 每一行的宽度 */
|
/** 每一行的宽度 */
|
||||||
printWidth: 120,
|
printWidth: 120,
|
||||||
/** Tab 键的空格数 */
|
|
||||||
tabWidth: 2,
|
|
||||||
/** 在对象中的括号之间是否用空格来间隔 */
|
/** 在对象中的括号之间是否用空格来间隔 */
|
||||||
bracketSpacing: true,
|
bracketSpacing: true,
|
||||||
/** 箭头函数的参数无论有几个,都要括号包裹 */
|
/** 箭头函数的参数无论有几个,都要括号包裹 */
|
||||||
@ -19,7 +18,5 @@ export default {
|
|||||||
/** 对象或者数组的最后一个元素后面不要加逗号 */
|
/** 对象或者数组的最后一个元素后面不要加逗号 */
|
||||||
trailingComma: "none",
|
trailingComma: "none",
|
||||||
/** 是否加分号 */
|
/** 是否加分号 */
|
||||||
semi: false,
|
semi: false
|
||||||
/** 是否使用 Tab 格式化 */
|
|
||||||
useTabs: false
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user