/** * @file Prettier 配置文件 * @author hotok * @date 2024-06-10 * @lastEditor hotok * @lastEditTime 2024-06-10 * @description 统一代码格式,配合 ESLint 使用 */ module.exports = { printWidth: 120, // 每行最大长度 tabWidth: 4, // 缩进空格数 useTabs: false, // 使用空格缩进 semi: true, // 语句末尾加分号 singleQuote: true, // 使用单引号 quoteProps: 'as-needed', // 仅在需要时为对象的key加引号 jsxSingleQuote: true, // JSX中使用单引号 trailingComma: 'all', // 多行对象/数组最后一个元素后加逗号 bracketSpacing: true, // 对象大括号内两边加空格 jsxBracketSameLine: false, // JSX > 是否另起一行 arrowParens: 'always', // 箭头函数参数总是加括号 endOfLine: 'lf', // 换行符使用lf proseWrap: 'preserve', // markdown等文本自动换行 htmlWhitespaceSensitivity: 'css', // html空白敏感度 embeddedLanguageFormatting: 'auto', // 格式化嵌入代码 };