From 2f70379463f63e26c6af92a0a798288e640446ac Mon Sep 17 00:00:00 2001 From: "WANGFAN\\wangf" <15871339963@163.com> Date: Thu, 5 Dec 2024 16:08:49 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E.stylelintignore?= =?UTF-8?q?=E3=80=81=E6=96=B0=E5=A2=9Eprettier-vscode=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eslintrc.cjs | 5 ++--- .prettierrc.cjs | 12 ++++++------ .stylelintignore | 4 ++++ .vscode/extensions.json | 2 +- .vscode/settings.json | 34 ++++++++++++++++++++++++++++++++-- 5 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 .stylelintignore diff --git a/.eslintrc.cjs b/.eslintrc.cjs index a1c01b3..e2a7548 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -37,6 +37,8 @@ module.exports = { * "error" 或 2 ==> 规则作为一个错误(代码不能执行,界面报错) */ rules: { + // 3. 注意要加上这一句,开启 prettier 自动修复的功能 + "prettier/prettier": "error", // 配置: // eslint (http://eslint.cn/docs/rules) "no-var": "error", // 要求使用 let 或 const 而不是 var @@ -44,9 +46,6 @@ module.exports = { "prefer-const": "off", // 使用 let 关键字声明但在初始分配后从未重新分配的变量,要求使用 const "no-use-before-define": "off", // 禁止在 函数/类/变量 定义之前使用它们 - // 3. 注意要加上这一句,开启 prettier 自动修复的功能 - "prettier/prettier": "error", - // typeScript (https://typescript-eslint.io/rules) "@typescript-eslint/no-unused-vars": "error", // 禁止定义未使用的变量 "@typescript-eslint/no-empty-function": "error", // 禁止空函数 diff --git a/.prettierrc.cjs b/.prettierrc.cjs index 96a40ad..77317ce 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -12,29 +12,29 @@ module.exports = { // 使用单引号 (true:单引号,false:双引号) singleQuote: false, // 在对象字面量中决定是否将属性名用引号括起来 可选值 "" - quoteProps: "as-needed", + quoteProps: 'as-needed', // 在JSX中使用单引号而不是双引号 (true:单引号,false:双引号) jsxSingleQuote: false, // 多行时尽可能打印尾随逗号 可选值"" - trailingComma: "none", + trailingComma: 'none', // 在对象,数组括号与文字之间加空格 "{ foo: bar }" (true:有,false:没有) bracketSpacing: true, // 将 > 多行元素放在最后一行的末尾,而不是单独放在下一行 (true:放末尾,false:单独一行) bracketSameLine: false, // (x) => {} 箭头函数参数只有一个时是否要有小括号 (avoid:省略括号,always:不省略括号) - arrowParens: "avoid", + arrowParens: 'avoid', // 指定要使用的解析器,不需要写文件开头的 @prettier requirePragma: false, // 可以在文件顶部插入一个特殊标记,指定该文件已使用 Prettier 格式化 insertPragma: false, // 用于控制文本是否应该被换行以及如何进行换行 - proseWrap: "preserve", + proseWrap: 'preserve', // 在html中空格是否是敏感的 "css" - 遵守 CSS 显示属性的默认值, "strict" - 空格被认为是敏感的 ,"ignore" - 空格被认为是不敏感的 - htmlWhitespaceSensitivity: "css", + htmlWhitespaceSensitivity: 'css', // 控制在 Vue 单文件组件中