-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.prettierrc.js
69 lines (61 loc) · 1.31 KB
/
.prettierrc.js
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// 这个文件是要配合 vscode 的插件 prettier 使用的,要确保编辑器安装了 prettier插件
module.exports = {
/**
* 字符串使用单引号
*/
singleQuote: true,
/**
* 对象最后一个元素自动添加 拖尾逗号
* none: 不添加
*/
trailingComma: 'none',
/**
* 每行末尾自动添加分号
*/
semi: false,
/**
* tab缩进大小,默认为2
*/
tabWidth: 2,
/**
* 使用tab缩进,默认false
*/
useTabs: false,
/**
* 对象中打印空格 默认true
* true: { foo: bar }
* false: {foo: bar}
*/
bracketSpacing: true,
/**
* 箭头函数参数括号 默认avoid 可选 avoid| always
* avoid 能省略括号的时候就省略 例如x => x
* always 总是有括号
*/
arrowParens: 'avoid',
/**
* 换行长度,默认80
*/
printWidth: 200,
/**
* 将多行JSX元素的 > 放在最后一行的末尾,而不是单独放在下一行
* 例子:
* 设置为true时:
* <button
className="prettier-class"
id="prettier-id"
onClick={this.handleClick}>
Click Here
</button>
*
* 设置为false时
* <button
className="prettier-class"
id="prettier-id"
onClick={this.handleClick}
>
Click Here
</button>
*/
jsxBracketSameLine: true
}