diff --git a/.eslintrc.cjs b/.eslintrc.cjs index d0e5325ad..091ae2275 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -2,55 +2,6 @@ module.exports = { extends: ['@vexip-ui/eslint-config'], root: true, rules: { - 'import/order': [ - 'error', - { - groups: [ - 'builtin', - 'external', - 'internal', - 'parent', - 'index', - 'sibling', - 'object', - 'unknown', - 'type' - ], - pathGroups: [ - { - pattern: 'vitest', - group: 'external', - position: 'before' - }, - { - pattern: 'vue', - group: 'external', - position: 'before' - }, - { - pattern: './*.vue', - group: 'external', - position: 'before' - }, - { - pattern: '@/components/**', - group: 'external', - position: 'before' - }, - { - pattern: 'vexip-ui', - group: 'external', - position: 'before' - }, - { - pattern: '@vexip-ui/**', - group: 'external', - position: 'before' - } - ], - pathGroupsExcludedImportTypes: ['type'] - } - ], '@typescript-eslint/no-use-before-define': 'off', 'vue/no-v-html': 'off', 'vue/no-textarea-mustache': 'off' diff --git a/common/config/src/icons.ts b/common/config/src/icons.ts index eecdb5ee1..3d455d418 100644 --- a/common/config/src/icons.ts +++ b/common/config/src/icons.ts @@ -1,67 +1,68 @@ import { computed, - unref, - provide, + defineAsyncComponent, + getCurrentScope, inject, markRaw, - defineAsyncComponent, - getCurrentScope + provide, + unref } from 'vue' + import { - Spinner, - ChevronUp, - ChevronRight, - ChevronDown, - ChevronLeft, - CircleXmark, - Xmark, - CalendarR, - ClockR, - ArrowRightArrowLeft, - AngleUp, - AngleRight, AngleDown, AngleLeft, - AnglesRight, + AngleRight, + AngleUp, AnglesLeft, - Retweet, + AnglesRight, + ArrowRightArrowLeft, + ArrowRightFromBracket, + ArrowRotateLeft, + ArrowRotateRight, ArrowsRotate, - CaretUp, - CaretRight, + CalendarR, CaretDown, CaretLeft, - Filter, - Ellipsis, - Upload, - CloudArrowUp, + CaretRight, + CaretUp, Check, - CircleQuestionR, - Flag, - CircleQuestion, - CircleInfo, + ChevronDown, + ChevronLeft, + ChevronRight, + ChevronUp, CircleCheck, CircleExclamation, - TrashCanR, + CircleInfo, + CircleQuestion, + CircleQuestionR, + CircleXmark, + ClockR, + CloudArrowUp, + Compress, + Ellipsis, + Exclamation, + Expand, EyeR, + EyeSlashR, + Filter, + Flag, + GripLinesVertical, ImageR, - Plus, - Minus, + Indent, Info, - Exclamation, - EyeSlashR, - User, - Sun, + MagnifyingGlass, + Minus, Moon, - ArrowRightFromBracket, - Indent, Outdent, - MagnifyingGlass, - ArrowRotateLeft, - ArrowRotateRight, + Plus, Repeat, - Expand, - Compress, - GripLinesVertical + Retweet, + Spinner, + Sun, + TrashCanR, + Upload, + User, + Xmark } from '@vexip-ui/icons' import { ensureArray } from '@vexip-ui/utils' diff --git a/common/config/src/locale/index.ts b/common/config/src/locale/index.ts index 06396a6c5..2b545442c 100644 --- a/common/config/src/locale/index.ts +++ b/common/config/src/locale/index.ts @@ -1,4 +1,5 @@ -import { computed, provide, inject, unref } from 'vue' +import { computed, inject, provide, unref } from 'vue' + import { mergeObjects } from '@vexip-ui/utils' import { zhCNLocale } from './zh-CN' diff --git a/common/config/src/namespace.ts b/common/config/src/namespace.ts index 35f49e24e..ed2f8cddc 100644 --- a/common/config/src/namespace.ts +++ b/common/config/src/namespace.ts @@ -1,4 +1,4 @@ -import { computed, provide, inject, unref } from 'vue' +import { computed, inject, provide, unref } from 'vue' import type { App, ComputedRef } from 'vue' import type { MaybeRef } from './types' diff --git a/common/config/src/props.ts b/common/config/src/props.ts index bb87d88be..ad08cdb4a 100644 --- a/common/config/src/props.ts +++ b/common/config/src/props.ts @@ -1,15 +1,16 @@ -import { reactive, computed, watch, provide, inject, unref } from 'vue' -import { has, isNull, isObject, isFunction, mergeObjects } from '@vexip-ui/utils' +import { computed, inject, provide, reactive, unref, watch } from 'vue' -import type { App, ComputedRef, PropType, CSSProperties, ComponentObjectPropsOptions } from 'vue' -import type { LocaleNames, LocaleConfig } from './locale' +import { has, isFunction, isNull, isObject, mergeObjects } from '@vexip-ui/utils' + +import type { App, CSSProperties, ComponentObjectPropsOptions, ComputedRef, PropType } from 'vue' +import type { LocaleConfig, LocaleNames } from './locale' import type { + AnyFunction, EnsureValue, - MaybeRef, Expand, - AnyFunction, - VoidFunction, - MaybeFunction + MaybeFunction, + MaybeRef, + VoidFunction } from './types' export type PropsOptions = Record> diff --git a/common/config/src/z-index.ts b/common/config/src/z-index.ts index a40da8d91..a30b5e7e3 100644 --- a/common/config/src/z-index.ts +++ b/common/config/src/z-index.ts @@ -1,4 +1,5 @@ -import { computed, provide, inject, unref, getCurrentInstance } from 'vue' +import { computed, getCurrentInstance, inject, provide, unref } from 'vue' + import { isClient, isDefined } from '@vexip-ui/utils' import type { App, ComputedRef } from 'vue' diff --git a/common/hooks/src/clickoutside.ts b/common/hooks/src/clickoutside.ts index e256dc6de..e3fde6fd7 100644 --- a/common/hooks/src/clickoutside.ts +++ b/common/hooks/src/clickoutside.ts @@ -1,13 +1,14 @@ -import { ref, unref, watch, getCurrentScope, onScopeDispose } from 'vue' +import { getCurrentScope, onScopeDispose, ref, unref, watch } from 'vue' + import { CLICK_TYPE, - isClient, - noop, createEvent, - getObservers, - observe, disconnect, - dispatchEvent + dispatchEvent, + getObservers, + isClient, + noop, + observe } from '@vexip-ui/utils' import { useListener } from './listener' diff --git a/common/hooks/src/display.ts b/common/hooks/src/display.ts index 28eee8263..e1ca6dc8e 100644 --- a/common/hooks/src/display.ts +++ b/common/hooks/src/display.ts @@ -1,4 +1,5 @@ -import { ref, nextTick, onMounted, onBeforeUnmount } from 'vue' +import { nextTick, onBeforeUnmount, onMounted, ref } from 'vue' + import { noop } from '@vexip-ui/utils' import type { Ref } from 'vue' diff --git a/common/hooks/src/full-screen.ts b/common/hooks/src/full-screen.ts index 521a91ec9..05ea0defc 100644 --- a/common/hooks/src/full-screen.ts +++ b/common/hooks/src/full-screen.ts @@ -1,4 +1,5 @@ -import { ref, computed, getCurrentScope, onScopeDispose } from 'vue' +import { computed, getCurrentScope, onScopeDispose, ref } from 'vue' + import { isClient, noop } from '@vexip-ui/utils' import type { Ref } from 'vue' diff --git a/common/hooks/src/hover.ts b/common/hooks/src/hover.ts index b3834378f..bac971853 100644 --- a/common/hooks/src/hover.ts +++ b/common/hooks/src/hover.ts @@ -1,4 +1,5 @@ import { ref } from 'vue' + import { useListener } from './listener' import type { Ref } from 'vue' diff --git a/common/hooks/src/intersection.ts b/common/hooks/src/intersection.ts index 8078f35e5..2073df3d7 100644 --- a/common/hooks/src/intersection.ts +++ b/common/hooks/src/intersection.ts @@ -1,5 +1,6 @@ -import { ref, unref, watch, getCurrentScope, onScopeDispose } from 'vue' -import { isClient, noop, ensureArray } from '@vexip-ui/utils' +import { getCurrentScope, onScopeDispose, ref, unref, watch } from 'vue' + +import { ensureArray, isClient, noop } from '@vexip-ui/utils' import type { Ref } from 'vue' diff --git a/common/hooks/src/listener.ts b/common/hooks/src/listener.ts index e8f87e819..a2cd9f529 100644 --- a/common/hooks/src/listener.ts +++ b/common/hooks/src/listener.ts @@ -1,4 +1,5 @@ -import { unref, watch, getCurrentScope, onScopeDispose } from 'vue' +import { getCurrentScope, onScopeDispose, unref, watch } from 'vue' + import { noop } from '@vexip-ui/utils' import type { MaybeRef } from './shared/types' diff --git a/common/hooks/src/modifier.ts b/common/hooks/src/modifier.ts index 388139926..eee19f379 100644 --- a/common/hooks/src/modifier.ts +++ b/common/hooks/src/modifier.ts @@ -1,4 +1,5 @@ -import { ref, unref, reactive, computed } from 'vue' +import { computed, reactive, ref, unref } from 'vue' + import { noop } from '@vexip-ui/utils' import { useListener } from './listener' diff --git a/common/hooks/src/mounted.ts b/common/hooks/src/mounted.ts index 46b048b86..635824255 100644 --- a/common/hooks/src/mounted.ts +++ b/common/hooks/src/mounted.ts @@ -1,4 +1,4 @@ -import { ref, onMounted, onBeforeUnmount } from 'vue' +import { onBeforeUnmount, onMounted, ref } from 'vue' export function useMounted() { const isMounted = ref(false) diff --git a/common/hooks/src/moving.ts b/common/hooks/src/moving.ts index 072854735..c6ca100f2 100644 --- a/common/hooks/src/moving.ts +++ b/common/hooks/src/moving.ts @@ -1,4 +1,5 @@ -import { ref, isRef, computed } from 'vue' +import { computed, isRef, ref } from 'vue' + import { throttle } from '@vexip-ui/utils' import { useListener } from './listener' diff --git a/common/hooks/src/pointer.ts b/common/hooks/src/pointer.ts index 992f530eb..6ca497979 100644 --- a/common/hooks/src/pointer.ts +++ b/common/hooks/src/pointer.ts @@ -1,4 +1,5 @@ -import { ref, onBeforeUnmount } from 'vue' +import { onBeforeUnmount, ref } from 'vue' + import { throttle } from '@vexip-ui/utils' import type { Ref } from 'vue' diff --git a/common/hooks/src/popper.ts b/common/hooks/src/popper.ts index 7fb6ca48a..36f8ae619 100644 --- a/common/hooks/src/popper.ts +++ b/common/hooks/src/popper.ts @@ -1,8 +1,9 @@ -import { ref, watch, watchEffect, nextTick, onMounted, onBeforeUnmount } from 'vue' +import { nextTick, onBeforeUnmount, onMounted, ref, watch, watchEffect } from 'vue' + import { createPopper as createInternalPopper } from '@popperjs/core' import type { Ref, WatchStopHandle } from 'vue' -import type { Placement, Modifier, Instance, Rect, VirtualElement } from '@popperjs/core' +import type { Instance, Modifier, Placement, Rect, VirtualElement } from '@popperjs/core' import type { TransferNode } from '@vexip-ui/utils' type OffsetsFunction = (options: { diff --git a/common/hooks/src/virtual.ts b/common/hooks/src/virtual.ts index 35c050e47..85f40b1ac 100644 --- a/common/hooks/src/virtual.ts +++ b/common/hooks/src/virtual.ts @@ -1,5 +1,6 @@ -import { ref, computed, onMounted, onBeforeUnmount, nextTick } from 'vue' -import { isDefined, createBITree, nextFrameOnce } from '@vexip-ui/utils' +import { computed, nextTick, onBeforeUnmount, onMounted, ref } from 'vue' + +import { createBITree, isDefined, nextFrameOnce } from '@vexip-ui/utils' import { isHiddenElement } from './display' import { observeResize, unobserveResize } from './resize' diff --git a/common/plugins/src/unplugin-vue-components.ts b/common/plugins/src/unplugin-vue-components.ts index 0e422d280..53e78daa3 100644 --- a/common/plugins/src/unplugin-vue-components.ts +++ b/common/plugins/src/unplugin-vue-components.ts @@ -1,5 +1,6 @@ import { readFileSync } from 'node:fs' -import { toKebabCase, isNull } from '@vexip-ui/utils' + +import { isNull, toKebabCase } from '@vexip-ui/utils' import { getPackageInfoSync, resolveModule } from 'local-pkg' import { compare } from 'compare-versions' diff --git a/common/utils/src/transform.ts b/common/utils/src/transform.ts index 67c5f3fde..63d5b2d8b 100644 --- a/common/utils/src/transform.ts +++ b/common/utils/src/transform.ts @@ -1,4 +1,4 @@ -import { isDefined, isObject, isFunction, toTrue } from './common' +import { isDefined, isFunction, isObject, toTrue } from './common' import { deepClone } from './deep-clone' export function ensureArray(value: T | T[]) { diff --git a/common/utils/src/vnode.ts b/common/utils/src/vnode.ts index f052cd2fb..50518dff1 100644 --- a/common/utils/src/vnode.ts +++ b/common/utils/src/vnode.ts @@ -1,4 +1,4 @@ -import { isVNode, createTextVNode, Fragment, Comment } from 'vue' +import { Comment, Fragment, createTextVNode, isVNode } from 'vue' import type { VNode, VNodeNormalizedChildren } from 'vue' diff --git a/components/alert/alert.vue b/components/alert/alert.vue index f003d2c2b..35c8274de 100644 --- a/components/alert/alert.vue +++ b/components/alert/alert.vue @@ -44,10 +44,12 @@ diff --git a/docs/demos/icon/basis/demo.zh-CN.vue b/docs/demos/icon/basis/demo.zh-CN.vue index 53dc32fdc..86e5418f3 100644 --- a/docs/demos/icon/basis/demo.zh-CN.vue +++ b/docs/demos/icon/basis/demo.zh-CN.vue @@ -8,5 +8,5 @@ diff --git a/docs/demos/icon/scale/demo.en-US.vue b/docs/demos/icon/scale/demo.en-US.vue index 5c35e19c8..96d0cccf0 100644 --- a/docs/demos/icon/scale/demo.en-US.vue +++ b/docs/demos/icon/scale/demo.en-US.vue @@ -8,5 +8,5 @@ diff --git a/docs/demos/icon/scale/demo.zh-CN.vue b/docs/demos/icon/scale/demo.zh-CN.vue index 5c35e19c8..96d0cccf0 100644 --- a/docs/demos/icon/scale/demo.zh-CN.vue +++ b/docs/demos/icon/scale/demo.zh-CN.vue @@ -8,5 +8,5 @@ diff --git a/docs/demos/input/before/demo.en-US.vue b/docs/demos/input/before/demo.en-US.vue index 5be16b28d..4946e67ed 100644 --- a/docs/demos/input/before/demo.en-US.vue +++ b/docs/demos/input/before/demo.en-US.vue @@ -33,18 +33,18 @@ @@ -52,6 +52,7 @@ diff --git a/docs/demos/input/icon/demo.zh-CN.vue b/docs/demos/input/icon/demo.zh-CN.vue index b4c4d7cd5..46bd1e5b4 100644 --- a/docs/demos/input/icon/demo.zh-CN.vue +++ b/docs/demos/input/icon/demo.zh-CN.vue @@ -1,15 +1,15 @@ diff --git a/docs/demos/layout/actions/demo.en-US.vue b/docs/demos/layout/actions/demo.en-US.vue index 7ebee1d1f..6cc83f227 100644 --- a/docs/demos/layout/actions/demo.en-US.vue +++ b/docs/demos/layout/actions/demo.en-US.vue @@ -8,7 +8,7 @@ @user-action="handleUserAction" > @@ -17,13 +17,13 @@ diff --git a/docs/demos/menu/basis/demo.zh-CN.vue b/docs/demos/menu/basis/demo.zh-CN.vue index 2562362d0..7ba286129 100644 --- a/docs/demos/menu/basis/demo.zh-CN.vue +++ b/docs/demos/menu/basis/demo.zh-CN.vue @@ -1,5 +1,5 @@ diff --git a/docs/demos/switch/icon/demo.zh-CN.vue b/docs/demos/switch/icon/demo.zh-CN.vue index c1029e5f7..a7576a8e2 100644 --- a/docs/demos/switch/icon/demo.zh-CN.vue +++ b/docs/demos/switch/icon/demo.zh-CN.vue @@ -3,5 +3,5 @@ diff --git a/docs/demos/switch/loading/demo.en-US.vue b/docs/demos/switch/loading/demo.en-US.vue index 8d7898b75..aaa8dd0bb 100644 --- a/docs/demos/switch/loading/demo.en-US.vue +++ b/docs/demos/switch/loading/demo.en-US.vue @@ -7,6 +7,7 @@