From 8c855b5b3d1b04ba42d2a5c14eb2297067f2bdd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=A5=E6=B5=A9?= Date: Fri, 28 Feb 2025 11:56:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20ESLint=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=AE=8F=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E5=92=8C=E5=AF=BC=E5=85=A5=E5=90=8E=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint.config.ts | 7 +++++++ .../UseIntersectionObserverInfiniteLoading.vue | 10 +++++----- src/pages/AntdV/HAPopconfirmButton.vue | 3 +-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/eslint.config.ts b/eslint.config.ts index 475ba2d..72d1d5c 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -61,6 +61,13 @@ export default defineConfigWithVueTs( order: ['script', 'template', 'style'], }, ], + 'vue/define-macros-order': [ + 'error', + { + order: ['defineOptions', 'defineProps', 'defineEmits', 'defineSlots'], + }, + ], + 'import/newline-after-import': 'error', }, }, diff --git a/src/components/UseIntersectionObserverInfiniteLoading.vue b/src/components/UseIntersectionObserverInfiniteLoading.vue index 5b2868c..890e1e7 100644 --- a/src/components/UseIntersectionObserverInfiniteLoading.vue +++ b/src/components/UseIntersectionObserverInfiniteLoading.vue @@ -38,6 +38,11 @@ const props = defineProps<{ errorText: string; }>(); +const emit = defineEmits<{ + load: []; + clickError: []; +}>(); + defineSlots<{ // 加载中 loading(): unknown; @@ -65,11 +70,6 @@ const check = (reason?: string) => { }); }; -const emit = defineEmits<{ - load: []; - clickError: []; -}>(); - const target = ref(null); const { pause, resume } = useIntersectionObserver( diff --git a/src/pages/AntdV/HAPopconfirmButton.vue b/src/pages/AntdV/HAPopconfirmButton.vue index eeb86b6..e606690 100644 --- a/src/pages/AntdV/HAPopconfirmButton.vue +++ b/src/pages/AntdV/HAPopconfirmButton.vue @@ -2,14 +2,13 @@ import type { PopconfirmProps } from 'ant-design-vue'; defineOptions({ inheritAttrs: true }); +const props = defineProps(); type NotUndefined = T extends undefined ? never : T; type PopconfirmOnConfirmParameters = Parameters>; type HPopconfirmProps = { onConfirm?: (...args: PopconfirmOnConfirmParameters) => Promise; }; -const props = defineProps(); - const _loading = shallowRef(false); const onConfirm: PopconfirmProps['onConfirm'] = async (e) => { if (props.onConfirm) {