Skip to content

Commit

Permalink
style: normalize lint for imports ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed May 16, 2023
1 parent b8f63d5 commit 39e8b80
Show file tree
Hide file tree
Showing 580 changed files with 2,023 additions and 1,552 deletions.
49 changes: 0 additions & 49 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
87 changes: 44 additions & 43 deletions common/config/src/icons.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
3 changes: 2 additions & 1 deletion common/config/src/locale/index.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion common/config/src/namespace.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
17 changes: 9 additions & 8 deletions common/config/src/props.ts
Original file line number Diff line number Diff line change
@@ -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<string, Record<string, unknown>>
Expand Down
3 changes: 2 additions & 1 deletion common/config/src/z-index.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
13 changes: 7 additions & 6 deletions common/hooks/src/clickoutside.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
3 changes: 2 additions & 1 deletion common/hooks/src/display.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
3 changes: 2 additions & 1 deletion common/hooks/src/full-screen.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
1 change: 1 addition & 0 deletions common/hooks/src/hover.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ref } from 'vue'

import { useListener } from './listener'

import type { Ref } from 'vue'
Expand Down
5 changes: 3 additions & 2 deletions common/hooks/src/intersection.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
3 changes: 2 additions & 1 deletion common/hooks/src/listener.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
3 changes: 2 additions & 1 deletion common/hooks/src/modifier.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion common/hooks/src/mounted.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ref, onMounted, onBeforeUnmount } from 'vue'
import { onBeforeUnmount, onMounted, ref } from 'vue'

export function useMounted() {
const isMounted = ref(false)
Expand Down
3 changes: 2 additions & 1 deletion common/hooks/src/moving.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
3 changes: 2 additions & 1 deletion common/hooks/src/pointer.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
5 changes: 3 additions & 2 deletions common/hooks/src/popper.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand Down
5 changes: 3 additions & 2 deletions common/hooks/src/virtual.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
3 changes: 2 additions & 1 deletion common/plugins/src/unplugin-vue-components.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand Down
2 changes: 1 addition & 1 deletion common/utils/src/transform.ts
Original file line number Diff line number Diff line change
@@ -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<T>(value: T | T[]) {
Expand Down
2 changes: 1 addition & 1 deletion common/utils/src/vnode.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isVNode, createTextVNode, Fragment, Comment } from 'vue'
import { Comment, Fragment, createTextVNode, isVNode } from 'vue'

import type { VNode, VNodeNormalizedChildren } from 'vue'

Expand Down
6 changes: 4 additions & 2 deletions components/alert/alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@
</template>

<script lang="ts">
import { defineComponent, ref, computed, watch, onMounted } from 'vue'
import { CollapseTransition } from '@/components/collapse-transition'
import { Icon } from '@/components/icon'
import { useNameHelper, useProps, useIcons, emitEvent } from '@vexip-ui/config'
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
import { emitEvent, useIcons, useNameHelper, useProps } from '@vexip-ui/config'
import { getRangeWidth } from '@vexip-ui/utils'
import { alertProps } from './props'
Expand Down
4 changes: 2 additions & 2 deletions components/alert/props.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { buildProps, booleanProp, eventProp } from '@vexip-ui/config'
import { booleanProp, buildProps, eventProp } from '@vexip-ui/config'

import type { PropType, ExtractPropTypes } from 'vue'
import type { ExtractPropTypes, PropType } from 'vue'
import type { ConfigurableProps } from '@vexip-ui/config'
import type { AlertType } from './symbol'

Expand Down
5 changes: 3 additions & 2 deletions components/alert/tests/alert.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { describe, it, expect, vi } from 'vitest'
import { CircleInfo, CircleCheck, CircleExclamation, CircleXmark } from '@vexip-ui/icons'
import { describe, expect, it, vi } from 'vitest'
import { mount } from '@vue/test-utils'

import { CircleCheck, CircleExclamation, CircleInfo, CircleXmark } from '@vexip-ui/icons'
import { Alert } from '..'

const typeIconMap = {
Expand Down
3 changes: 2 additions & 1 deletion components/alert/tests/ssr.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
* @vitest-environment node
*/

import { describe, it, expect } from 'vitest'
import { describe, expect, it } from 'vitest'
import { createSSRApp } from 'vue'

import { renderToString } from 'vue/server-renderer'
import { Alert } from '..'

Expand Down

0 comments on commit 39e8b80

Please sign in to comment.