Fanfou Wiki

我等采石之人,当心怀建造大教堂之愿景。

用户工具

站点工具


prettier

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
prettier [2021/10/21 17:21] adminprettier [2021/11/08 18:02] (当前版本) admin
行 11: 行 11:
   * https://prettier.io/docs/en/options.html   * https://prettier.io/docs/en/options.html
  
-<code bash> +<file javascript .prettierrc.js
-echo {} > .prettierrc.yml +module.exports = { 
-</code+  // https://github.com/google/gts/blob/main/.prettierrc.json 
- +  bracketSpacing: false, 
-<file yaml .prettier.yml> +  singleQuote: true, 
-# 单行代码的最大宽度 +  trailingComma"es5", 
-printWidth: 80 +  arrowParens"avoid", 
-# 使用制表符 (tab) 缩进行而不是空格 (space) +  overrides: [ 
-useTabs: false +    { 
-# 指定每个缩进级别的空格数 +      files: ["*.html", "*.tsx", "*.vue"], 
-tabWidth: 2 +      options: { 
-# 在语句末尾打印分号 +        printWidth: 120, 
-semi: true +      }, 
-# 使用单引号而不是双引号 +    }, 
-singleQuotefalse +  ], 
-# 换行格式 +};
-endOfLinelf +
- +
-overrides: +
-  files: "*.html" +
-    options: +
-      printWidth: 120 +
-      tabWidth: 2 +
-  - files: "*.vue" +
-    options: +
-      printWidth: 120 +
-      tabWidth: 2 +
-  - files: "*.tsx" +
-    options: +
-      printWidth: 120 +
-      tabWidth: 2+
  
 </file> </file>
行 52: 行 37:
 build build
 coverage coverage
- 
-# Ignore all HTML files: 
-*.html 
  
 </file> </file>
  
-**使用**+===== 使用 ===== 
 <code bash> <code bash>
-npx prettier --write .+npx prettier --write --ignore-unknown .
 </code> </code>
 +
 +===== Pre-commit Hook =====
 +  * https://prettier.io/docs/en/precommit.html#option-1-lint-stagedhttpsgithubcomokonetlint-staged
 +
 +<code bash>
 +npx mrm@2 lint-staged
 +</code>
 +
prettier.1634808106.txt.gz · 最后更改: 2021/10/21 17:21 由 admin