prettier
这是本文档旧的修订版!
Prettier
安装
npm install --save-dev --save-exact prettier
配置
echo {} > .prettierrc.yml
- .prettier.yml
# 单行代码的最大宽度 printWidth: 100 # 使用单引号而不是双引号 singleQuote: false overrides: - files: "*.html" options: printWidth: 120 - files: "*.vue" options: printWidth: 120 - files: "*.tsx" options: printWidth: 120
Ignoring Code
- .prettierignore
# Ignore artifacts: build coverage # Ignore all HTML files: *.html
使用
npx prettier --write .
Pre-commit Hook
prettier.1634808524.txt.gz · 最后更改: 2021/10/21 17:28 由 admin