AI-guangzhou-uniapp/.prettierrc.js

26 lines
1.5 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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是尾部逗号兼容es5none就是没有尾部逗号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'
}
}
]
}