-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.prettierrc.cjs
21 lines (21 loc) · 1.41 KB
/
.prettierrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module.exports = {
printWidth: 150, // 每行代码长度(默认80)
tabWidth: 2, // 缩进空格数
useTabs: false, //不用tab缩进
semi: true, //// 在语句末尾打印分号
singleQuote: true, // 使用单引号而不是双引号
vueIndentScriptAndStyle: true, //Vue文件脚本和样式标签缩进
quoteProps: 'as-needed', // 更改引用对象属性的时间 可选值"<as-needed|consistent|preserve>"
jsxSingleQuote: true, // 在JSX中使用单引号而不是双引号
trailingComma: 'es5', //多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"<none|es5|all>",默认none
bracketSpacing: true, // 在对象文字中的括号之间打印空格
jsxBracketSameLine: false, //jsx 标签的反尖括号需要换行
arrowParens: 'always', // 在单独的箭头函数参数周围包括括号 always:(x) => x \ avoid:x => x
rangeStart: 0, // 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码
rangeEnd: Infinity,
requirePragma: false, // 指定要使用的解析器,不需要写文件开头的 @prettier
insertPragma: false, // 不需要自动在文件开头插入 @prettier
proseWrap: 'preserve', // 使用默认的折行标准 always\never\preserve
htmlWhitespaceSensitivity: 'css', // 指定HTML文件的全局空格敏感度 css\strict\ignore
endOfLine: 'auto',
};