Skip to content

Commit

Permalink
style: lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
zzxming committed Sep 2, 2024
1 parent eeb97d9 commit f68ef36
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/demos/captcha/point.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { type CheckStatusInfo } from 'cdx-component';
import type { CheckStatusInfo } from 'cdx-component';
import { computed, ref } from 'vue';
const imgs = [
Expand Down
3 changes: 2 additions & 1 deletion packages/components/collapse/src/collapse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import { provide } from 'vue';
import { useBem, useModelValue } from '@cdx-component/hooks';
import { CHANGE_EVENT } from '@cdx-component/constants';
import { CollapseModelValueType, collapseEmits, collapseProps } from './collapse';
import type { CollapseModelValueType } from './collapse';
import { collapseEmits, collapseProps } from './collapse';
import { collapseContextKey } from './constants';
defineOptions({ name: 'CdxCollapse' });
Expand Down
4 changes: 2 additions & 2 deletions packages/components/drawer/src/drawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ defineOptions({ name: 'CdxDrawer' });
const props = defineProps(drawerProps);
defineEmits(drawerEmits);
const slots = defineSlots<{
default(): any;
swipe?(): any;
default: () => any;
swipe?: () => any;
}>();
const [, bem] = useBem('drawer');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@cdx-component/constants';
import { useBem } from '@cdx-component/hooks';
import { selectContextKey } from './constants';
import { elementSelectItemEmits, elementSelectItemProps } from './element-select-item';
import { ElementSelectValueType } from './element-select';
import type { ElementSelectValueType } from './element-select';
defineOptions({ name: 'CdxElementSelectItem' });
const props = defineProps(elementSelectItemProps);
Expand Down
3 changes: 2 additions & 1 deletion packages/components/element-select/src/element-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { computed, nextTick, provide, ref, toRefs } from 'vue';
import { pick } from '@cdx-component/utils';
import { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@cdx-component/constants';
import { useBem } from '@cdx-component/hooks';
import { ElementSelectValueType, elementSelectEmits, elementSelectProps } from './element-select';
import type { ElementSelectValueType } from './element-select';
import { elementSelectEmits, elementSelectProps } from './element-select';
import { selectContextKey } from './constants';
defineOptions({ name: 'CdxElementSelect' });
Expand Down
4 changes: 3 additions & 1 deletion packages/components/loading/src/loading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ watch(
);
onMounted(() => {
useLockScroll(isLock, { target: loadingRef.value?.parentElement! });
if (loadingRef.value?.parentElement) {
useLockScroll(isLock, { target: loadingRef.value.parentElement });
}
});
</script>

Expand Down
7 changes: 5 additions & 2 deletions packages/components/overlay/src/overlay.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { StyleValue, computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import type { StyleValue } from 'vue';
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import { useBem, useLockScroll, useModelValue, useZIndex } from '@cdx-component/hooks';
import { vSameClickTarget } from '@cdx-component/directives';
import { overlayEmits, overlayProps } from './overlay';
Expand Down Expand Up @@ -37,7 +38,9 @@ watch(
);
onMounted(() => {
useLockScroll(model, { target: overlayRef.value?.parentElement! });
if (overlayRef.value?.parentElement) {
useLockScroll(model, { target: overlayRef.value.parentElement });
}
});
onBeforeUnmount(() => {
overlayRef.value?.parentElement?.classList.remove(scrollBem.bm('lock'));
Expand Down
3 changes: 2 additions & 1 deletion packages/components/resize/src/resize-dragger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import { useBem, useSupportTouch, useTeleportContainer, useZIndex } from '@cdx-component/hooks';
import { inject, onBeforeUnmount, onMounted, ref } from 'vue';
import { resizeDraggerProps } from './resize-dragger';
import { Direction, RESIZE_INJECTION_KEY } from './constants';
import type { Direction } from './constants';
import { RESIZE_INJECTION_KEY } from './constants';
defineOptions({ name: 'CdxDraggerResize' });
const props = defineProps(resizeDraggerProps);
Expand Down
1 change: 1 addition & 0 deletions packages/utils/__tests__/number.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-loss-of-precision */
import { describe, expect, it } from 'vitest';
import { getDecimalLength, getIntegerLength, toFixed, toStringNumber } from '..';

Expand Down
1 change: 1 addition & 0 deletions packages/utils/__tests__/props.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ describe('test types about vue props', () => {
required: true,
}),
} as const;
// eslint-disable-next-line vitest/valid-expect
expectTypeOf<ExtractPropTypes<typeof _props1>>().branded.toEqualTypeOf<{
readonly key1?: string;
readonly key2: string | number;
Expand Down

0 comments on commit f68ef36

Please sign in to comment.