| 12345678910111213141516171819202122232425 |
- export default {
- printWidth: 100, // 每行最大字符数
- tabWidth: 2, // 制表符对应的空格数
- semi: false, // 禁止自动添加分号
- vueIndentScriptAndStyle: true, // 确保Vue文件中script和style标签的缩进正确
- plugins: ['prettier-plugin-tailwindcss'],
- // 引号与括号配置
- singleQuote: true, // 使用单引号包裹字符串
- quoteProps: 'as-needed', // 仅在必要时为对象属性添加引号
- bracketSpacing: true, // 对象字面量括号内添加空格
- trailingComma: 'es5', // 在ES5允许的位置添加末尾逗号
- // JSX与箭头函数配置
- jsxBracketSameLine: false, // JSX闭合标签不与前一行同列
- jsxSingleQuote: false, // JSX属性使用双引号
- arrowParens: 'always', // 箭头函数参数必须用括号包裹
- // 其他配置
- insertPragma: false, // 不自动插入Prettier pragma指令
- requirePragma: false, // 不要求文件包含Prettier pragma指令
- proseWrap: 'never', // 不自动换行处理多行文本
- htmlWhitespaceSensitivity: 'ignore', // 忽略HTML空白字符敏感规则
- endOfLine: 'lf', // 文件结尾使用LF换行符
- rangeStart: 0, // 格式化范围起始位置(默认从0开始)
- }
|