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