26 lines
1.5 KiB
JavaScript
26 lines
1.5 KiB
JavaScript
module.exports = {
|
||
printWidth: 150, // 一行代码的最大字符数
|
||
tabWidth: 2, // tab宽度为2空格
|
||
useTabs: false, // 是否使用tab来缩进
|
||
semi: false, // 结尾是否添加分号
|
||
singleQuote: true, // 使用单引号
|
||
quoteProps: 'as-needed', // object对象中key值是否加引号 as-needed只有在需求要的情况下加引号,consistent是有一个需要引号就统一加,preserve是保留用户输入的引号
|
||
jsxSingleQuote: true, // 在jsx中使用单引号代替双引号
|
||
trailingComma: 'none', // 尾部逗号设置,es5是尾部逗号兼容es5,none就是没有尾部逗号,all是指所有可能的情况
|
||
bracketSpacing: true, // object对象里面的key和value值和括号间的空格 默认true
|
||
jsxBracketSameLine: false, // jsx标签多行属性写法时中把'>' 是否单独放一行
|
||
arrowParens: 'always', // 箭头函数单个参数的情况是否省略括号,默认always是总是带括号 avoid:省略括号
|
||
proseWrap: 'preserve', // 换行方式 默认值。因为使用了一些折行敏感型的渲染器(如GitHub comment)而按照markdown文本样式进行折行
|
||
htmlWhitespaceSensitivity: 'ignore', // 根据显示样式决定 html 要不要折行
|
||
endOfLine: 'lf', // "<lf|crlf|cr|auto>" 行尾换行符,默认是lf
|
||
// Prettier 支持对某些文件扩展名,文件夹和特定文件进行不同的配置
|
||
overrides: [
|
||
{
|
||
files: '.prettierrc',
|
||
options: {
|
||
parser: 'json'
|
||
}
|
||
}
|
||
]
|
||
}
|