-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprettier-init
37 lines (32 loc) · 1.02 KB
/
prettier-init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# 用于自动配置prettier
# 配置参考
# 1. http://www.yulilong.cn/doc/tool/004-prettier%E4%BB%A3%E7%A0%81%E6%A0%BC%E5%BC%8F%E5%8C%96%E5%B7%A5%E5%85%B7.html#_1-%E9%85%8D%E7%BD%AE
# 2. https://juejin.cn/post/7013281180019589134
# 使用方式
# 1. 首先将本脚本放置在/usr/local/bin目录下
# 2. 然后执行命令sudo chmod +x /usr/local/bin/prettier-init
# 3. 在需要初始化commitizen的项目目录下执行命令prettier-init
cat >.prettierrc.json <<EOF
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"quoteProps": "consistent",
"jsxSingleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"requirePragma": false,
"insertPragma": false,
"proseWrap": "preserve",
"htmlWhitespaceSensitivity": "ignore",
"vueIndentScriptAndStyle": true,
"endOfLine": "lf",
"embeddedLanguageFormatting": "auto"
}
EOF
echo -e "\033[32m 初始化完成(.prettierrc.json) \033[0m"