diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 69c2fc75..5c8537e4 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -7,7 +7,7 @@ module.exports = { }, parser: "vue-eslint-parser", extends: [ - // 参考vuejs官方的eslint配置: https://eslint.vuejs.org/user-guide/#usage + // https://eslint.vuejs.org/user-guide/#usage "plugin:vue/vue3-recommended", "./.eslintrc-auto-import.json", "prettier", @@ -24,21 +24,9 @@ module.exports = { }, 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类型的警告 + // https://eslint.vuejs.org/rules/#priority-a-essential-error-prevention + "vue/multi-word-component-names": "off", "vue/no-v-model-argument": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/ban-ts-ignore": "off", - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-var-requires": "off", - "@typescript-eslint/no-empty-function": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-non-null-assertion": "off", - "@typescript-eslint/explicit-module-boundary-types": "off", "vue/script-setup-uses-vars": "error", "vue/no-reserved-component-names": "off", "vue/custom-event-name-casing": "off", @@ -63,7 +51,22 @@ module.exports = { math: "always", }, ], - "vue/multi-word-component-names": "off", + + "@typescript-eslint/no-empty-function": "off", // 关闭空方法检查 + "@typescript-eslint/no-explicit-any": "off", // 关闭any类型的警告 + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/ban-ts-ignore": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-var-requires": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/no-unused-vars": "off", + "prettier/prettier": [ "error", { diff --git a/src/components/IconSelect/index.vue b/src/components/IconSelect/index.vue index e4f925fc..8b26e7c5 100644 --- a/src/components/IconSelect/index.vue +++ b/src/components/IconSelect/index.vue @@ -146,8 +146,7 @@ onMounted(() => { .icon-item { display: flex; flex-direction: column; - align-items: center; - justify-items: center; + place-items: center center; width: 10%; padding: 5px; margin: 0 10px 10px 0; diff --git a/src/layout/components/NavBar/NavRight.vue b/src/layout/components/NavBar/NavRight.vue index 35c595e5..904f0182 100644 --- a/src/layout/components/NavBar/NavRight.vue +++ b/src/layout/components/NavBar/NavRight.vue @@ -104,8 +104,7 @@ function logout() { .avatar-container { display: flex; - align-items: center; - justify-items: center; + place-items: center center; margin: 0 5px; cursor: pointer; diff --git a/src/layout/components/Settings/index.vue b/src/layout/components/Settings/index.vue index 93d81bb0..6caa9965 100644 --- a/src/layout/components/Settings/index.vue +++ b/src/layout/components/Settings/index.vue @@ -3,7 +3,6 @@ import { useSettingsStore } from "@/store/modules/settings"; import { usePermissionStore } from "@/store/modules/permission"; import { useAppStore } from "@/store/modules/app"; import { useRoute } from "vue-router"; -import defaultSettings from "@/settings"; const route = useRoute(); diff --git a/src/layout/components/Sidebar/Item.vue b/src/layout/components/Sidebar/Item.vue index c25a033c..9ca788f6 100644 --- a/src/layout/components/Sidebar/Item.vue +++ b/src/layout/components/Sidebar/Item.vue @@ -1,9 +1,5 @@ @@ -12,7 +8,7 @@ import SvgIcon from "@/components/SvgIcon/index.vue"; import { translateRouteTitle } from "@/utils/i18n"; -const props = defineProps({ +defineProps({ icon: { type: String, default: "", diff --git a/src/views/demo/icons.vue b/src/views/demo/icons.vue index 643702a6..5fd397fe 100644 --- a/src/views/demo/icons.vue +++ b/src/views/demo/icons.vue @@ -99,7 +99,7 @@ const svg_icons: string[] = [ ]; const icons = ref(ElementPlusIconsVue); -const { text, isSupported, copy } = useClipboard(); +const { copy } = useClipboard(); function generateIconCode(symbol: any) { return ``; diff --git a/src/views/demo/signature.vue b/src/views/demo/signature.vue index ee713325..c63fc444 100644 --- a/src/views/demo/signature.vue +++ b/src/views/demo/signature.vue @@ -132,35 +132,6 @@ function paint( ctx.closePath(); ctx.stroke(); } - -// 橡皮 -function eraser( - startX: number, - startY: number, - endX: number, - endY: number, - ctx: CanvasRenderingContext2D, - size: number, - shape: "rect" | "circle" -) { - ctx.beginPath(); - ctx.globalAlpha = 1; - switch (shape) { - case "rect": - ctx.lineWidth = size; - ctx.strokeStyle = "#fff"; - ctx.moveTo(startX, startY); - ctx.lineTo(endX, endY); - ctx.closePath(); - ctx.stroke(); - break; - case "circle": - ctx.fillStyle = "#fff"; - ctx.arc(startX, startY, size, 0, 2 * Math.PI); - ctx.fill(); - break; - } -}