diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 361770f..e5af4c7 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -5,123 +5,123 @@ module.exports = { es2021: true, node: true, }, - parser: "vue-eslint-parser", + parser: 'vue-eslint-parser', extends: [ // https://eslint.vuejs.org/user-guide/#usage - "plugin:vue/vue3-recommended", - "./.eslintrc-auto-import.json", - "prettier", - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended", + 'plugin:vue/vue3-recommended', + './.eslintrc-auto-import.json', + 'prettier', + 'plugin:@typescript-eslint/recommended', + 'plugin:prettier/recommended', ], parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - parser: "@typescript-eslint/parser", - project: "./tsconfig.*?.json", + ecmaVersion: 'latest', + sourceType: 'module', + parser: '@typescript-eslint/parser', + project: './tsconfig.*?.json', createDefaultProgram: false, - extraFileExtensions: [".vue"], + extraFileExtensions: ['.vue'], }, - plugins: ["vue", "@typescript-eslint"], + plugins: ['vue', '@typescript-eslint'], rules: { // 禁止使用 var,用 let 和 const 代替 - "no-var": "error", + 'no-var': 'error', // 在 Vue 的 v-for 循环中要求使用 :key - "vue/require-v-for-key": "error", // vue的for循环是否必须有key + 'vue/require-v-for-key': 'error', // vue的for循环是否必须有key // 关闭 Vue 组件名必须多字的规则 - "vue/multi-word-component-names": "off", + 'vue/multi-word-component-names': 'off', // 关闭 Vue 的 v-model 中的参数规则 - "vue/no-v-model-argument": "off", + 'vue/no-v-model-argument': 'off', // Vue 的 setup() 函数必须使用的变量规则 - "vue/script-setup-uses-vars": "error", + 'vue/script-setup-uses-vars': 'error', // 关闭 Vue 组件名的保留规则 - "vue/no-reserved-component-names": "off", + 'vue/no-reserved-component-names': 'off', // 关闭 Vue 事件名的命名规则 - "vue/custom-event-name-casing": "off", + 'vue/custom-event-name-casing': 'off', // 关闭 Vue 属性的顺序规则 - "vue/attributes-order": "off", + 'vue/attributes-order': 'off', // 关闭一个文件只能有一个组件规则 - "vue/one-component-per-file": "off", + 'vue/one-component-per-file': 'off', // 关闭 HTML 标签闭合换行规则 - "vue/html-closing-bracket-newline": "off", + 'vue/html-closing-bracket-newline': 'off', // 关闭 HTML 属性每行最大数量规则 - "vue/max-attributes-per-line": "off", + 'vue/max-attributes-per-line': 'off', // 关闭多行 HTML 元素内容的规则 - "vue/multiline-html-element-content-newline": "off", + 'vue/multiline-html-element-content-newline': 'off', // 关闭单行 HTML 元素内容的规则 - "vue/singleline-html-element-content-newline": "off", + 'vue/singleline-html-element-content-newline': 'off', // 关闭 HTML 属性连字符的规则 - "vue/attribute-hyphenation": "off", + 'vue/attribute-hyphenation': 'off', // 关闭要求 Vue 默认属性的规则 - "vue/require-default-prop": "off", + 'vue/require-default-prop': 'off', // 关闭要求 Vue 显式触发事件的规则 - "vue/require-explicit-emits": "off", + 'vue/require-explicit-emits': 'off', // HTML 标签自闭合规则 - "vue/html-self-closing": [ - "error", + 'vue/html-self-closing': [ + 'error', { html: { - void: "always", // 自闭合标签必须自闭合 - normal: "never", // 普通标签不得自闭合 - component: "always", // 组件标签必须自闭合 + void: 'always', // 自闭合标签必须自闭合 + normal: 'never', // 普通标签不得自闭合 + component: 'always', // 组件标签必须自闭合 }, - svg: "always", - math: "always", + svg: 'always', + math: 'always', }, ], // 警告空方法检查 - "@typescript-eslint/no-empty-function": "warn", + '@typescript-eslint/no-empty-function': 'warn', // 关闭 any 类型的警告 - "@typescript-eslint/no-explicit-any": "off", + '@typescript-eslint/no-explicit-any': 'off', // 关闭使用 @ts-ignore 的警告 - "@typescript-eslint/ban-ts-ignore": "off", + '@typescript-eslint/ban-ts-ignore': 'off', // 关闭使用 @ts-comment 的警告 - "@typescript-eslint/ban-ts-comment": "off", + '@typescript-eslint/ban-ts-comment': 'off', // 关闭一些特定类型的警告 - "@typescript-eslint/ban-types": "off", + '@typescript-eslint/ban-types': 'off', // 关闭函数返回类型的警告 - "@typescript-eslint/explicit-function-return-type": "off", + '@typescript-eslint/explicit-function-return-type': 'off', // 关闭 any 类型的警告 - "@typescript-eslint/no-explicit-any": "off", + '@typescript-eslint/no-explicit-any': 'off', // 关闭使用 require 的警告 - "@typescript-eslint/no-var-requires": "off", + '@typescript-eslint/no-var-requires': 'off', // 关闭使用尚未定义的变量的警告 - "@typescript-eslint/no-use-before-define": "off", + '@typescript-eslint/no-use-before-define': 'off', // 关闭模块导出类型的警告 - "@typescript-eslint/explicit-module-boundary-types": "off", + '@typescript-eslint/explicit-module-boundary-types': 'off', // 未使用的变量的警告 - "@typescript-eslint/no-unused-vars": "warn", + '@typescript-eslint/no-unused-vars': 'warn', // Prettier 配置 - "prettier/prettier": [ - "error", + 'prettier/prettier': [ + 'error', { useTabs: false, // 不使用制表符 }, @@ -130,12 +130,12 @@ module.exports = { // eslint不能对html文件生效 overrides: [ { - files: ["*.html"], - processor: "vue/.vue", + files: ['*.html'], + processor: 'vue/.vue', }, ], // https://eslint.org/docs/latest/use/configure/language-options#specifying-globals globals: { - OptionType: "readonly", + OptionType: 'readonly', }, }; diff --git a/.prettierrc.cjs b/.prettierrc.cjs index 1e170e7..c56c302 100644 --- a/.prettierrc.cjs +++ b/.prettierrc.cjs @@ -24,7 +24,7 @@ module.exports = { // 结尾添加分号 semi: true, // 使用单引号 (true:单引号;false:双引号) - singleQuote: false, + singleQuote: true, // 缩进空格数,默认2个空格 tabWidth: 2, // 元素末尾是否加逗号,默认es5: ES5中的 objects, arrays 等会添加逗号,TypeScript 中的 type 后不加逗号 diff --git a/commitlint.config.cjs b/commitlint.config.cjs index c07a631..a4348a0 100644 --- a/commitlint.config.cjs +++ b/commitlint.config.cjs @@ -1,45 +1,45 @@ module.exports = { // 继承的规则 - extends: ["@commitlint/config-conventional"], + extends: ['@commitlint/config-conventional'], // 自定义规则 rules: { // @see https://commitlint.js.org/#/reference-rules // 提交类型枚举,git提交type必须是以下类型 - "type-enum": [ + 'type-enum': [ 2, - "always", + 'always', [ - "feat", // 新增功能 - "fix", // 修复缺陷 - "docs", // 文档变更 - "style", // 代码格式(不影响功能,例如空格、分号等格式修正) - "refactor", // 代码重构(不包括 bug 修复、功能新增) - "perf", // 性能优化 - "test", // 添加疏漏测试或已有测试改动 - "build", // 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等) - "ci", // 修改 CI 配置、脚本 - "revert", // 回滚 commit - "chore", // 对构建过程或辅助工具和库的更改(不影响源文件、测试用例) + 'feat', // 新增功能 + 'fix', // 修复缺陷 + 'docs', // 文档变更 + 'style', // 代码格式(不影响功能,例如空格、分号等格式修正) + 'refactor', // 代码重构(不包括 bug 修复、功能新增) + 'perf', // 性能优化 + 'test', // 添加疏漏测试或已有测试改动 + 'build', // 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等) + 'ci', // 修改 CI 配置、脚本 + 'revert', // 回滚 commit + 'chore', // 对构建过程或辅助工具和库的更改(不影响源文件、测试用例) ], ], - "subject-case": [0], // subject大小写不做校验 + 'subject-case': [0], // subject大小写不做校验 }, prompt: { messages: { - type: "选择你要提交的类型 :", - scope: "选择一个提交范围(可选):", - customScope: "请输入自定义的提交范围 :", - subject: "填写简短精炼的变更描述 :\n", + type: '选择你要提交的类型 :', + scope: '选择一个提交范围(可选):', + customScope: '请输入自定义的提交范围 :', + subject: '填写简短精炼的变更描述 :\n', body: '填写更加详细的变更描述(可选)。使用 "|" 换行 :\n', breaking: '列举非兼容性重大的变更(可选)。使用 "|" 换行 :\n', - footerPrefixesSelect: "选择关联issue前缀(可选):", - customFooterPrefix: "输入自定义issue前缀 :", - footer: "列举关联issue (可选) 例如: #31, #I3244 :\n", - generatingByAI: "正在通过 AI 生成你的提交简短描述...", - generatedSelectByAI: "选择一个 AI 生成的简短描述:", - confirmCommit: "是否提交或修改commit ?", + footerPrefixesSelect: '选择关联issue前缀(可选):', + customFooterPrefix: '输入自定义issue前缀 :', + footer: '列举关联issue (可选) 例如: #31, #I3244 :\n', + generatingByAI: '正在通过 AI 生成你的提交简短描述...', + generatedSelectByAI: '选择一个 AI 生成的简短描述:', + confirmCommit: '是否提交或修改commit ?', }, // prettier-ignore types: [ @@ -56,28 +56,28 @@ module.exports = { { value: "chore", name: "其他: 🛠️ 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)", emoji: ":hammer:"}, ], useEmoji: true, - emojiAlign: "center", + emojiAlign: 'center', useAI: false, aiNumber: 1, - themeColorCode: "", + themeColorCode: '', scopes: [], allowCustomScopes: true, allowEmptyScopes: true, - customScopesAlign: "bottom", - customScopesAlias: "custom", - emptyScopesAlias: "empty", + customScopesAlign: 'bottom', + customScopesAlias: 'custom', + emptyScopesAlias: 'empty', upperCaseSubject: false, markBreakingChangeMode: false, - allowBreakingChanges: ["feat", "fix"], + allowBreakingChanges: ['feat', 'fix'], breaklineNumber: 100, - breaklineChar: "|", + breaklineChar: '|', skipQuestions: [], issuePrefixes: [ - { value: "closed", name: "closed: ISSUES has been processed" }, + { value: 'closed', name: 'closed: ISSUES has been processed' }, ], - customIssuePrefixAlign: "top", - emptyIssuePrefixAlias: "skip", - customIssuePrefixAlias: "custom", + customIssuePrefixAlign: 'top', + emptyIssuePrefixAlias: 'skip', + customIssuePrefixAlias: 'custom', allowCustomIssuePrefix: true, allowEmptyIssuePrefix: true, confirmColorize: true, @@ -85,9 +85,9 @@ module.exports = { maxSubjectLength: Infinity, minSubjectLength: 0, scopeOverrides: undefined, - defaultBody: "", - defaultIssues: "", - defaultScope: "", - defaultSubject: "", + defaultBody: '', + defaultIssues: '', + defaultScope: '', + defaultSubject: '', }, }; diff --git a/package.json b/package.json index b11fb50..8981aa0 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "stylelint-config-recommended-vue": "^1.5.0", "stylelint-config-standard": "^34.0.0", "stylelint-config-standard-scss": "^11.1.0", - "tailwindcss": "^3.3.3", + "tailwindcss": "^3.4.1", "typescript": "^5.3.2", "unplugin-auto-import": "^0.15.3", "unplugin-icons": "^0.16.6", @@ -107,4 +107,4 @@ "engines": { "node": ">=16.0.0" } -} \ No newline at end of file +} diff --git a/src/App.vue b/src/App.vue index 3695021..2050a8c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,14 +17,14 @@ diff --git a/src/components/Table/src/components/editable/EditableCell.vue b/src/components/Table/src/components/editable/EditableCell.vue index a00dbc7..8568000 100644 --- a/src/components/Table/src/components/editable/EditableCell.vue +++ b/src/components/Table/src/components/editable/EditableCell.vue @@ -347,9 +347,9 @@ export default defineComponent({ } if (props.record) { - initCbs("submitCbs", handleSubmit); - initCbs("validCbs", handleSubmiRule); - initCbs("cancelCbs", handleCancel); + initCbs('submitCbs', handleSubmit); + initCbs('validCbs', handleSubmiRule); + initCbs('cancelCbs', handleCancel); if (props.column.key) { if (!props.record.editValueRefs) props.record.editValueRefs = {}; @@ -372,7 +372,7 @@ export default defineComponent({ if (!pass) return; const submitFns = props.record?.submitCbs || []; submitFns.forEach((fn) => fn(false, false)); - table.emit?.("edit-row-end"); + table.emit?.('edit-row-end'); return true; } }; diff --git a/src/style.css b/src/style.css index 0be5ea6..4eee630 100644 --- a/src/style.css +++ b/src/style.css @@ -1,6 +1,6 @@ :root { font-family: Inter, system-ui, Avenir, Helvetica, Arial, YouSheBiaoTiHei, - "sans-serif "; + 'sans-serif '; font-weight: 400; line-height: 1.5; color: rgb(255 255 255 / 87%); diff --git a/src/styles/index.scss b/src/styles/index.scss index a70ab42..3c1e836 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1 +1 @@ -@import 'transition/index'; \ No newline at end of file +@import 'transition/index'; diff --git a/src/styles/tailwind.css b/src/styles/tailwind.css index bd6213e..b5c61c9 100644 --- a/src/styles/tailwind.css +++ b/src/styles/tailwind.css @@ -1,3 +1,3 @@ @tailwind base; @tailwind components; -@tailwind utilities; \ No newline at end of file +@tailwind utilities; diff --git a/src/styles/transition/base.scss b/src/styles/transition/base.scss index 5837d76..484f9d3 100644 --- a/src/styles/transition/base.scss +++ b/src/styles/transition/base.scss @@ -15,4 +15,4 @@ .expand-x-transition { @include transition-default; -} \ No newline at end of file +} diff --git a/src/styles/transition/fade.scss b/src/styles/transition/fade.scss index f9ed05a..1f8e63e 100644 --- a/src/styles/transition/fade.scss +++ b/src/styles/transition/fade.scss @@ -78,4 +78,4 @@ .fade-top-leave-to { opacity: 0; transform: translateY(-8%); -} \ No newline at end of file +} diff --git a/src/styles/transition/index.scss b/src/styles/transition/index.scss index a97eb47..21ba08d 100644 --- a/src/styles/transition/index.scss +++ b/src/styles/transition/index.scss @@ -6,5 +6,6 @@ @import './zoom'; .collapse-transition { - transition: 0.2s height ease-in-out, 0.2s padding-top ease-in-out, 0.2s padding-bottom ease-in-out; -} \ No newline at end of file + transition: 0.2s height ease-in-out, 0.2s padding-top ease-in-out, + 0.2s padding-bottom ease-in-out; +} diff --git a/src/styles/transition/scale.scss b/src/styles/transition/scale.scss index db18095..5fbd120 100644 --- a/src/styles/transition/scale.scss +++ b/src/styles/transition/scale.scss @@ -18,4 +18,4 @@ opacity: 0; transform: scale(0) rotate(-45deg); } -} \ No newline at end of file +} diff --git a/src/styles/transition/scroll.scss b/src/styles/transition/scroll.scss index c04da26..9550314 100644 --- a/src/styles/transition/scroll.scss +++ b/src/styles/transition/scroll.scss @@ -64,4 +64,4 @@ &-leave-to { transform: translateX(-15px); } -} \ No newline at end of file +} diff --git a/src/styles/transition/slide.scss b/src/styles/transition/slide.scss index fb1fc85..9dbd30f 100644 --- a/src/styles/transition/slide.scss +++ b/src/styles/transition/slide.scss @@ -36,4 +36,4 @@ opacity: 0; transform: translateX(15px); } -} \ No newline at end of file +} diff --git a/src/styles/transition/zoom.scss b/src/styles/transition/zoom.scss index 41682b9..2ea378c 100644 --- a/src/styles/transition/zoom.scss +++ b/src/styles/transition/zoom.scss @@ -24,4 +24,4 @@ .zoom-fade-leave-to { opacity: 0; transform: scale(1.06); -} \ No newline at end of file +} diff --git a/src/views/redirect/index.vue b/src/views/redirect/index.vue index 4b1e6a3..6663398 100644 --- a/src/views/redirect/index.vue +++ b/src/views/redirect/index.vue @@ -1,10 +1,10 @@