给 Prettier 使用的 .prettierrc 配置文件,具体配置项可参考 官方文档,需要已安装 prettier 和 VSCode prettier 格式化插件。
以下是我使用的配置,偏好是单引号以及无分号结尾:
{
"printWidth": 100,
"singleQuote": true,
"semi": false,
"trailingComma": "es5",
"tabWidth": 2,
"arrowParens": "avoid",
"endOfLine": "lf"
}