30 lines
883 B
JavaScript
30 lines
883 B
JavaScript
// 转换为 CommonJS 格式(重要!)
|
||
module.exports = {
|
||
printWidth: 100, // 最大行宽
|
||
semi: true, // 强制分号
|
||
singleQuote: true, // 使用单引号
|
||
trailingComma: 'all', // 自动尾逗号
|
||
tabWidth: 4, // 缩进空格数
|
||
|
||
// 新增常用配置
|
||
arrowParens: 'avoid', // 箭头函数单参数省略括号
|
||
bracketSpacing: true, // 对象花括号空格 { key: value }
|
||
endOfLine: 'auto', // 自动识别换行符
|
||
jsxBracketSameLine: false, // JSX 闭合标签换行(React 项目适用)
|
||
|
||
// 文件类型覆盖规则
|
||
overrides: [
|
||
{
|
||
files: '*.md',
|
||
options: {
|
||
proseWrap: 'always' // Markdown 自动换行
|
||
}
|
||
},
|
||
{
|
||
files: '*.json',
|
||
options: {
|
||
tabWidth: 4 // JSON 使用 2 空格缩进
|
||
}
|
||
}
|
||
]
|
||
}; // 移除结尾分号保持风格统一
|