Prettier配置
创建.prettierrc.js文件
// .prettierrc.js
module.exports = {
printWidth: 100, // 单行代码字符数量不能超过 100
tabWidth: 2, // tab 使用两个空格
useTabs: false, // 不使用制表符缩进,使用空格缩进
semi: false, // 不需要分号结束
// trailingComma: 'none', // 格式化时末尾不添加逗号
singleQuote: true, // 单引号
bracketSpacing: true, // 对象左右两侧都需要空格
htmlWhitespaceSensitivity: 'ignore' // 结束标签>跑到下一行
// endOfLine: 'auto', // 结尾是 \n \r \n\r auto
}