diff --git a/.husky/commit-msg b/.husky/commit-msg index fd2bf708..f6f2ce3f 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1 +1,2 @@ -npx --no-install commitlint --edit $1 +#!/usr/bin/env sh +npx --no-install commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit index beabb122..e77b172c 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,2 @@ -npm run lint:lint-staged +#!/usr/bin/env sh +npm run lint:lint-staged diff --git a/README.md b/README.md index 6c17bbbf..94cf9cb4 100644 --- a/README.md +++ b/README.md @@ -223,7 +223,7 @@ Thanks to all the contributors!
- ![]() + ![]() 公众号「有来技术」 |
diff --git a/eslint.config.ts b/eslint.config.ts index a8753377..4c32ca69 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -107,8 +107,8 @@ export default [ }, rules: { // 基础规则 - "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", - "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", + "no-console": ["error", { allow: ["warn", "error", "debug"] }], + "no-debugger": "error", // ES6+ 规则 "prefer-const": "error", @@ -116,7 +116,7 @@ export default [ "object-shorthand": "error", // 最佳实践 - eqeqeq: "off", + eqeqeq: ["error", "always", { null: "ignore" }], "no-multi-spaces": "error", "no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }], @@ -171,7 +171,7 @@ export default [ }, ], "vue/component-name-in-template-casing": ["error", "PascalCase"], - "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-explicit-any": "warn", }, }, @@ -189,7 +189,7 @@ export default [ }, rules: { // TypeScript 规则 - "@typescript-eslint/no-explicit-any": "off", // 允许使用any类型,方便开发 + "@typescript-eslint/no-explicit-any": "warn", // 逐步收敛 any 类型 "@typescript-eslint/no-empty-function": "off", "@typescript-eslint/no-empty-object-type": "off", "@typescript-eslint/ban-ts-comment": "off", diff --git a/mock/dict.mock.ts b/mock/dict.mock.ts index 131709b4..5452f658 100644 --- a/mock/dict.mock.ts +++ b/mock/dict.mock.ts @@ -145,7 +145,7 @@ export default defineMock([ let list = null; - if (dictCode == "gender") { + if (dictCode === "gender") { list = [ { value: "1", @@ -160,7 +160,7 @@ export default defineMock([ label: "保密", }, ]; - } else if (dictCode == "notice_level") { + } else if (dictCode === "notice_level") { list = [ { value: "L", @@ -178,7 +178,7 @@ export default defineMock([ tagType: "D", }, ]; - } else if (dictCode == "notice_type") { + } else if (dictCode === "notice_type") { list = [ { value: "1", diff --git a/src/App.vue b/src/App.vue index dca8b3a9..bc6d8b0f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,5 @@ |