-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.prettierrc.js
More file actions
35 lines (35 loc) · 1.24 KB
/
Copy path.prettierrc.js
File metadata and controls
35 lines (35 loc) · 1.24 KB
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
module.exports = {
useTabs: false, // 使用tab缩进,默认false
tabWidth: 2, // tab缩进大小,默认为2
semi: true, // 每行末尾自动添加分号
// 对象中打印空格 默认true
// true: { foo: bar }
// false: {foo: bar}
bracketSpacing: true,
// 箭头函数参数括号 默认avoid 可选 avoid| always
// avoid 能省略括号的时候就省略 例如x => x
// always 总是有括号
arrowParens: "always",
printWidth: 80, // 换行长度,默认80
endOfLine: "auto", // 结尾是 \n \r \n\r auto
jsxBracketSameLine: false, // > 标签放在最后一行的末尾,而不是单独放在下一行
jsxSingleQuote: true, // 在jsx中使用单引号代替双引号
singleQuote: true, // 字符串是否使用单引号,默认为false,使用双引号
stylelintIntegration: false, //不让prettier使用stylelint的代码格式进行校验
trailingComma: "es5", // 在对象或数组最后一个元素后面是否加逗号(在ES5中加尾逗号)
ignorePath: ".gitignore",
overrides: [
{
files: "*.wxml",
options: { parser: "html" },
},
{
files: "*.wxss",
options: { parser: "css" },
},
{
files: "*.wxs",
options: { parser: "babel" },
},
],
};