feat: 更新 ESLint 配置,添加宏定义顺序和导入后换行规则
This commit is contained in:
@ -61,6 +61,13 @@ export default defineConfigWithVueTs(
|
|||||||
order: ['script', 'template', 'style'],
|
order: ['script', 'template', 'style'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
'vue/define-macros-order': [
|
||||||
|
'error',
|
||||||
|
{
|
||||||
|
order: ['defineOptions', 'defineProps', 'defineEmits', 'defineSlots'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'import/newline-after-import': 'error',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -38,6 +38,11 @@ const props = defineProps<{
|
|||||||
errorText: string;
|
errorText: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
load: [];
|
||||||
|
clickError: [];
|
||||||
|
}>();
|
||||||
|
|
||||||
defineSlots<{
|
defineSlots<{
|
||||||
// 加载中
|
// 加载中
|
||||||
loading(): unknown;
|
loading(): unknown;
|
||||||
@ -65,11 +70,6 @@ const check = (reason?: string) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const emit = defineEmits<{
|
|
||||||
load: [];
|
|
||||||
clickError: [];
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const target = ref(null);
|
const target = ref(null);
|
||||||
|
|
||||||
const { pause, resume } = useIntersectionObserver(
|
const { pause, resume } = useIntersectionObserver(
|
||||||
|
@ -2,14 +2,13 @@
|
|||||||
import type { PopconfirmProps } from 'ant-design-vue';
|
import type { PopconfirmProps } from 'ant-design-vue';
|
||||||
defineOptions({ inheritAttrs: true });
|
defineOptions({ inheritAttrs: true });
|
||||||
|
|
||||||
|
const props = defineProps<HPopconfirmProps>();
|
||||||
type NotUndefined<T> = T extends undefined ? never : T;
|
type NotUndefined<T> = T extends undefined ? never : T;
|
||||||
type PopconfirmOnConfirmParameters = Parameters<NotUndefined<PopconfirmProps['onConfirm']>>;
|
type PopconfirmOnConfirmParameters = Parameters<NotUndefined<PopconfirmProps['onConfirm']>>;
|
||||||
type HPopconfirmProps = {
|
type HPopconfirmProps = {
|
||||||
onConfirm?: (...args: PopconfirmOnConfirmParameters) => Promise<void>;
|
onConfirm?: (...args: PopconfirmOnConfirmParameters) => Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
const props = defineProps<HPopconfirmProps>();
|
|
||||||
|
|
||||||
const _loading = shallowRef(false);
|
const _loading = shallowRef(false);
|
||||||
const onConfirm: PopconfirmProps['onConfirm'] = async (e) => {
|
const onConfirm: PopconfirmProps['onConfirm'] = async (e) => {
|
||||||
if (props.onConfirm) {
|
if (props.onConfirm) {
|
||||||
|
Reference in New Issue
Block a user