-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.prettierrc.cjs
29 lines (28 loc) · 1.38 KB
/
.prettierrc.cjs
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
module.exports = {
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 80,
tabWidth: 2,
endOfLine: 'lf',
};
// {
// arrowParens: 'always', // 单参数箭头函数参数周围使用圆括号-eg: (x) => x
// bracketSpacing: true, // 在对象前后添加空格-eg: { foo: bar }
// embeddedLanguageFormatting: 'auto', // 对引用代码进行格式化
// htmlWhitespaceSensitivity: 'css', // 对HTML全局空白不敏感
// insertPragma: false, // 在已被prettier格式化的文件顶部加上标注
// jsxBracketSameLine: true, // jsx文件中多属性html标签的‘>’折行放置
// jsxSingleQuote: true, // jsx中使用单引号
// proseWrap: 'preserve', // 不重要,默认preserve就好
// quoteProps: 'as-needed', // 仅在必需时为对象的key添加引号
// requirePragma: false, // 无需顶部注释即可格式化
// semi: true, // 句末使用分号
// singleQuote: true, // 使用单引号
// tabWidth: 2, // 缩进长度
// trailingComma: 'all', // 在多行逗号分隔的语法结构中尽可能打印尾随逗号(单行数组永远不会有尾随逗号)
// useTabs: false, // 使用空格代替tab缩进
// vueIndentScriptAndStyle: false, // 不对vue中的script及style标签缩进
// printWidth: 80, // 单行长度
// endOfLine: 'lf', // 仅仅换行(\n),在 Linux 和 macOS 以及 git 存储库中常见
// };