Skip to content

Commit

Permalink
✨ feat(prettier): 更新 prettier 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
siroi committed Sep 20, 2024
1 parent 9f56f62 commit 9e83a1f
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/prettier.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
module.exports = {
tabWidth: 2,
tabWidth: 4,
semi: true,
trailingComma: 'all',
singleQuote: true,
printWidth: 120
/**
* 建议使用 80 宽度折行
* @see https://prettier.nodejs.cn/docs/en/options.html#%E6%A0%87%E7%AD%BE%E5%AE%BD%E5%BA%A6
* @author siroi
* */
printWidth: 80,
/**
* 文件换行符需要用 lf 目的是为了 ci
* @see lf 在 Linux 和 macOS 以及 git repos 中很常见
*/
endOfLine: 'lf',
bracketSameLine: true,
bracketSpacing: true,
/**
* 允许箭头函数括号
* @author siroi
* */
arrowParens: 'always',
overrides: [
{
"files": ".prettierrc",
"options": { "parser": "json" }
}
]
};

0 comments on commit 9e83a1f

Please sign in to comment.