From c8e63d67d8d8e5d302c5abda0836abceab9686b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Sun, 20 Jun 2021 15:07:44 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E7=BB=9F=E4=B8=80=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web-react/.prettierrc.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 web-react/.prettierrc.js diff --git a/web-react/.prettierrc.js b/web-react/.prettierrc.js new file mode 100644 index 0000000..86e4998 --- /dev/null +++ b/web-react/.prettierrc.js @@ -0,0 +1,24 @@ +module.exports = { + "extends": [ + "airbnb", + "prettier", + "prettier/react" + ], + "printWidth": 100, // 超过最大值换行 + "tabWidth": 4, // 缩进字节数 + "useTabs": false, // 缩进不使用tab,使用空格 + "semi": false, // 句尾添加分号 + "singleQuote": true, // 使用单引号代替双引号 + "proseWrap": "preserve", // 默认值。因为使用了一些折行敏感型的渲染器(如GitHub comment)而按照markdown文本样式进行折行 + "arrowParens": "avoid", // (x) => {} 箭头函数参数只有一个时是否要有小括号。avoid:省略括号 + "bracketSpacing": true, // 在对象,数组括号与文字之间加空格 "{ foo: bar }" + "disableLanguages": ["vue"], // 不格式化vue文件,vue文件的格式化单独设置 + "endOfLine": "auto", // 结尾是 \n \r \n\r auto + "eslintIntegration": true, //是否让prettier使用eslint的代码格式进行校验 + "htmlWhitespaceSensitivity": "ignore", + "ignorePath": ".prettierignore", // 不使用prettier格式化的文件填写在项目的.prettierignore文件中 + "jsxBracketSameLine": false, // 在jsx中把'>' 单独放一行 + "jsxSingleQuote": false, // 在jsx中使用单引号代替双引号 + "trailingComma": "es5", // 在对象或数组最后一个元素后面是否加逗号(在ES5中加尾逗号) + "tslintIntegration": false // 不让prettier使用tslint的代码格式进行校验 +} \ No newline at end of file