diff --git a/.editorconfig b/.editorconfig index 3c3960b..dd76572 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,15 +1,14 @@ # http://editorconfig.org - root = true - -[*] # 表示所有文件适用 + +# 表示所有文件适用 +[*] charset = utf-8 # 设置文件字符集为 utf-8 -indent_style = space # 缩进风格(tab | space) -indent_size = 2 # 缩进大小 end_of_line = lf # 控制换行类型(lf | cr | crlf) -trim_trailing_whitespace = true # 去除行首的任意空白字符 +indent_style = tab # 缩进风格(tab | space) insert_final_newline = true # 始终在文件末尾插入一个新行 - -[*.md] # 表示仅 md 文件适用以下规则 -max_line_length = off -trim_trailing_whitespace = false \ No newline at end of file + +# 表示仅 md 文件适用以下规则 +[*.md] +max_line_length = off # 关闭最大行长度限制 +trim_trailing_whitespace = false # 关闭末尾空格修剪 diff --git a/.eslintignore b/.eslintignore index da6aa78..43af40f 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,19 +1,14 @@ -*.sh +dist node_modules -*.md -*.woff -*.ttf +public +.husky .vscode .idea -dist -/public -/docs -.husky -.local -/bin -.eslintrc.js -prettier.config.js +*.sh +*.md + src/assets -auto-imports.d.ts -components.d.ts +.eslintrc.cjs +.prettierrc.cjs +.stylelintrc.cjs diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..eb5a4c4 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,33 @@ +module.exports = { + env: { + browser: true, + es2021: true, + node: true, + }, + parser: "vue-eslint-parser", + // https://eslint.vuejs.org/user-guide/#bundle-configurations + extends: [ + "eslint:recommended", + "plugin:vue/vue3-essential", + "plugin:@typescript-eslint/recommended", + "./.eslintrc-auto-import.json", + ], + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + parser: "@typescript-eslint/parser", + }, + plugins: ["vue", "@typescript-eslint"], + rules: { + "vue/multi-word-component-names": "off", // 关闭组件名必须多字: https://eslint.vuejs.org/rules/multi-word-component-names.html + "@typescript-eslint/no-empty-function": "off", // 关闭空方法检查 + "@typescript-eslint/no-explicit-any": "off", // 关闭any类型的警告 + "vue/no-v-model-argument": "off", + "@typescript-eslint/no-non-null-assertion": "off", + }, + // https://eslint.org/docs/latest/use/configure/language-options#specifying-globals + globals: { + DialogOption: "readonly", + OptionType: "readonly", + }, +}; diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 722c3e0..0000000 --- a/.eslintrc.js +++ /dev/null @@ -1,33 +0,0 @@ - -module.exports = { - env: { - browser: true, - es2021: true, - node: true, - }, - parser: 'vue-eslint-parser', - // https://eslint.vuejs.org/user-guide/#bundle-configurations - extends: [ - 'eslint:recommended', - 'plugin:vue/vue3-essential', - 'plugin:@typescript-eslint/recommended', - "./.eslintrc-auto-import.json" - ], - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - parser: '@typescript-eslint/parser', - }, - plugins: ['vue', '@typescript-eslint'], - rules: { - 'vue/multi-word-component-names': 'off', - '@typescript-eslint/no-empty-function': 'off', // 关闭空方法检查 - '@typescript-eslint/no-explicit-any': 'off', // 关闭any类型的警告 - 'vue/no-v-model-argument': 'off' - }, - // https://eslint.org/docs/latest/use/configure/language-options#specifying-globals - globals: { - DialogOption: 'readonly', - OptionType:'readonly' - } -}; diff --git a/.prettierignore b/.prettierignore index d251d2e..d751f74 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,9 +1,10 @@ -/dist/* -.local -.output.js -/node_modules/** +dist +node_modules +public +.husky +.vscode +.idea +*.sh +*.md -**/*.svg -**/*.sh - -/public/* \ No newline at end of file +src/assets diff --git a/.prettierrc.cjs b/.prettierrc.cjs new file mode 100644 index 0000000..d39f28c --- /dev/null +++ b/.prettierrc.cjs @@ -0,0 +1,36 @@ +module.exports = { + // (x)=>{},单个参数箭头函数是否显示小括号。(always:始终显示;avoid:省略括号。默认:always) + arrowParens: "always", + // 开始标签的右尖括号是否跟随在最后一行属性末尾,默认false + bracketSameLine: false, + // 对象字面量的括号之间打印空格 (true - Example: { foo: bar } ; false - Example: {foo:bar}) + bracketSpacing: true, + // 是否格式化一些文件中被嵌入的代码片段的风格(auto|off;默认auto) + embeddedLanguageFormatting: "auto", + // 指定 HTML 文件的空格敏感度 (css|strict|ignore;默认css) + htmlWhitespaceSensitivity: "css", + // 当文件已经被 Prettier 格式化之后,是否会在文件顶部插入一个特殊的 @format 标记,默认false + insertPragma: false, + // 在 JSX 中使用单引号替代双引号,默认false + jsxSingleQuote: false, + // 每行最多字符数量,超出换行(默认80) + printWidth: 80, + // 超出打印宽度 (always | never | preserve ) + proseWrap: "preserve", + // 对象属性是否使用引号(as-needed | consistent | preserve;默认as-needed:对象的属性需要加引号才添加;) + quoteProps: "as-needed", + // 是否只格式化在文件顶部包含特定注释(@prettier| @format)的文件,默认false + requirePragma: false, + // 结尾添加分号 + semi: true, + // 使用单引号 (true:单引号;false:双引号) + singleQuote: false, + // 缩进空格数,默认2个空格 + tabWidth: 2, + // 元素末尾是否加逗号,默认es5: ES5中的 objects, arrays 等会添加逗号,TypeScript 中的 type 后不加逗号 + trailingComma: "es5", + // 指定缩进方式,空格或tab,默认false,即使用空格 + useTabs: false, + // vue 文件中是否缩进