Skip to content

Commit d028cce

Browse files
authored
chore: use type import (#4260)
1 parent b1bb913 commit d028cce

File tree

229 files changed

+549
-633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+549
-633
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"rules": {
3131
"@typescript-eslint/no-explicit-any": 0,
3232
"@typescript-eslint/ban-types": 0,
33+
"@typescript-eslint/consistent-type-imports": 1,
3334
"@typescript-eslint/explicit-module-boundary-types": 0,
3435
"@typescript-eslint/no-empty-function": 0,
3536
"@typescript-eslint/no-non-null-assertion": 0,

components/_util/colors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { ElementOf, tuple } from './type';
1+
import type { ElementOf } from './type';
2+
import { tuple } from './type';
23

34
export const PresetStatusColorTypes = tuple('success', 'processing', 'error', 'default', 'warning');
45

components/_util/hooks/useBreakpoint.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { onMounted, onUnmounted, Ref, ref } from 'vue';
2-
import ResponsiveObserve, { ScreenMap } from '../../_util/responsiveObserve';
1+
import type { Ref } from 'vue';
2+
import { onMounted, onUnmounted, ref } from 'vue';
3+
import type { ScreenMap } from '../../_util/responsiveObserve';
4+
import ResponsiveObserve from '../../_util/responsiveObserve';
35

46
function useBreakpoint(): Ref<ScreenMap> {
57
const screens = ref<ScreenMap>({});

components/_util/hooks/useConfigInject.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
import { RequiredMark } from '../../form/Form';
2-
import { computed, ComputedRef, inject, UnwrapRef, VNodeChild } from 'vue';
3-
import {
4-
ConfigProviderProps,
5-
defaultConfigProvider,
6-
Direction,
7-
SizeType,
8-
} from '../../config-provider';
1+
import type { RequiredMark } from '../../form/Form';
2+
import type { ComputedRef, UnwrapRef, VNodeChild } from 'vue';
3+
import { computed, inject } from 'vue';
4+
import type { ConfigProviderProps, Direction, SizeType } from '../../config-provider';
5+
import { defaultConfigProvider } from '../../config-provider';
96

107
export default (
118
name: string,

components/_util/hooks/useMemo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Ref, ref, watch } from 'vue';
1+
import type { Ref } from 'vue';
2+
import { ref, watch } from 'vue';
23

34
export default function useMemo<T>(
45
getValue: () => T,

components/_util/hooks/usePrefixCls.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { computed, ComputedRef, inject } from 'vue';
1+
import type { ComputedRef } from 'vue';
2+
import { computed, inject } from 'vue';
23
import { defaultConfigProvider } from '../../config-provider';
34

45
export default (name: string, props: Record<any, any>): ComputedRef<string> => {

components/_util/hooks/useRef.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { onBeforeUpdate, ref, Ref } from 'vue';
1+
import type { Ref } from 'vue';
2+
import { onBeforeUpdate, ref } from 'vue';
23

34
export type UseRef = [(el: any, key: string | number) => void, Ref<any>];
45

components/_util/hooks/useSize.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { computed, ComputedRef, inject, provide, UnwrapRef } from 'vue';
2-
import { ConfigProviderProps, defaultConfigProvider, SizeType } from '../../config-provider';
1+
import type { ComputedRef, UnwrapRef } from 'vue';
2+
import { computed, inject, provide } from 'vue';
3+
import type { ConfigProviderProps, SizeType } from '../../config-provider';
4+
import { defaultConfigProvider } from '../../config-provider';
35

46
const sizeProvider = Symbol('SizeProvider');
57

components/_util/props-util/initDefaultProps.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { PropType } from 'vue';
2-
import { VueTypeValidableDef, VueTypeDef } from 'vue-types';
1+
import type { PropType } from 'vue';
2+
import type { VueTypeValidableDef, VueTypeDef } from 'vue-types';
33

44
const initDefaultProps = <T>(
55
types: T,

components/_util/setStyle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CSSProperties } from 'vue';
1+
import type { CSSProperties } from 'vue';
22

33
/**
44
* Easy to set element style, return previous style

0 commit comments

Comments
 (0)