prettier
这是本文档旧的修订版!
Prettier
安装
yarn add --dev --exact prettier
配置
echo {}> .prettierrc.json
- .prettier.yml
# 单行代码的最大宽度 printWidth: 80 # 使用制表符 (tab) 缩进行而不是空格 (space) useTabs: false # 指定每个缩进级别的空格数 tabWidth: 2 # 在语句末尾打印分号 semi: true # 使用单引号而不是双引号 singleQuote: false # 换行格式 endOfLine: lf overrides: - files: "*.html" options: printWidth: 150 tabWidth: 2 - files: "*.vue" options: printWidth: 150 tabWidth: 2 - files: "*.tsx" options: printWidth: 150 tabWidth: 2
# Ignore artifacts: build coverage # Ignore all HTML files: *.html
使用
yarn prettier --write .
prettier.1627450389.txt.gz · 最后更改: 2021/07/28 13:33 由 admin