From d25f8c4cd864bf7b65f4ca40131de41426dc129b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=9D=E5=85=88=E7=91=9E?= <1490493387@qq.com> Date: Wed, 4 May 2022 14:57:37 +0800 Subject: [PATCH] =?UTF-8?q?chore(.prettierrc.js):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=8C=96=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 690ff90eb77eea7b3e5c4251034fa9113f855062 --- .prettierrc.js | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.prettierrc.js b/.prettierrc.js index 1e59e852..73b647f4 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,7 +1,7 @@ -// https://juejin.cn/post/6975442828386107400 +/** + * 代码格式化配置 + */ module.exports = { - // 一行最多多少个字符 - printWidth: 150, // 指定每个缩进级别的空格数 tabWidth: 2, // 使用制表符而不是空格缩进行 @@ -12,16 +12,12 @@ module.exports = { singleQuote: true, // 更改引用对象属性的时间 可选值"" quoteProps: 'as-needed', - // 在JSX中使用单引号而不是双引号 - jsxSingleQuote: false, // 多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"",默认none - trailingComma: 'es5', + trailingComma: 'none', // 在对象文字中的括号之间打印空格 bracketSpacing: true, - // jsx 标签的反尖括号需要换行 - jsxBracketSameLine: false, // 在单独的箭头函数参数周围包括括号 always:(x) => x \ avoid:x => x - arrowParens: 'always', + arrowParens: 'avoid', // 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码 rangeStart: 0, rangeEnd: Infinity, @@ -29,12 +25,12 @@ module.exports = { requirePragma: false, // 不需要自动在文件开头插入 @prettier insertPragma: false, - // 使用默认的折行标准 always\never\preserve - proseWrap: 'preserve', + // 换行设置 always\never\preserve + proseWrap: 'never', // 指定HTML文件的全局空格敏感度 css\strict\ignore htmlWhitespaceSensitivity: 'css', // Vue文件脚本和样式标签缩进 vueIndentScriptAndStyle: false, // 换行符使用 lf 结尾是 可选值"" - endOfLine: 'lf', -}; \ No newline at end of file + endOfLine: 'lf' +};