Skip to content

Commit

Permalink
ci: fix lint errors (#1641)
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Aug 8, 2023
1 parent d20b30c commit 97bdafb
Show file tree
Hide file tree
Showing 91 changed files with 108 additions and 109 deletions.
2 changes: 1 addition & 1 deletion packages/cdk/breakpoint/src/breakpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useMediaQuery } from './mediaQuery'

export const BREAKPOINTS_KEYS = ['xs', 'sm', 'md', 'lg', 'xl'] as const

export type BreakpointKey = (typeof BREAKPOINTS_KEYS)[number]
export type BreakpointKey = typeof BREAKPOINTS_KEYS[number]

export const BREAKPOINTS: Record<BreakpointKey, string> = {
xs: '(max-width: 599.99px)',
Expand Down
6 changes: 3 additions & 3 deletions packages/cdk/drag-drop/src/composables/useDraggable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* found in the LICENSE file at https://github.com/IDuxFE/idux/blob/main/LICENSE
*/

import type { DnDContext } from './useDragDropContext'
import type { DnDEventName, DnDEventType, DnDPosition, DraggableOptions } from '../types'
import type { DnDContext } from './useDragDropContext'

import { type ComputedRef, computed, ref, watch } from 'vue'

import { type MaybeElementRef, convertElement, tryOnScopeDispose, useEventListener } from '@idux/cdk/utils'

import { DnDState } from '../state'
import { extraMove, initContext, reMoveElement } from '../utils'
import { withBoundary } from './withBoundary'
import { withDragFree } from './withDragFree'
import { withDragHandle } from './withDragHandle'
import { DnDState } from '../state'
import { extraMove, initContext, reMoveElement } from '../utils'

/**
* make a element draggable
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk/drag-drop/src/composables/useDroppable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { watch } from 'vue'

import { type MaybeElementRef, convertElement, tryOnScopeDispose } from '@idux/cdk/utils'

import { type DnDContext } from './useDragDropContext'
import { initContext } from '../utils'
import { type DnDContext } from './useDragDropContext'

/**
* make a element droppable as a container and accept draggable element
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk/drag-drop/src/composables/withBoundary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* found in the LICENSE file at https://github.com/IDuxFE/idux/blob/main/LICENSE
*/

import { type DnDContext } from './useDragDropContext'
import { LockAxisType } from '../types'
import { type DnDContext } from './useDragDropContext'

export const withBoundary = (
sourceEl: HTMLElement,
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk/drag-drop/src/composables/withDragFree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import type { DnDEventType } from '../types'

import { type DnDContext } from './useDragDropContext'
import { moveElement } from '../utils'
import { type DnDContext } from './useDragDropContext'

export const withDragFree = (sourceEl: HTMLElement, context: DnDContext): void => {
const registry = context.registry
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk/drag-drop/src/draggable/Draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { computed, defineComponent, normalizeClass, reactive, ref } from 'vue'

import { callEmit } from '@idux/cdk/utils'

import { draggableProps } from './types'
import { useDraggable } from '../composables/useDraggable'
import { draggableProps } from './types'

const style = {
width: 'fit-content',
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk/forms/src/models/formArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import { type ComputedRef, computed, watch, watchEffect } from 'vue'

import { AbstractControl } from './abstractControl'
import { type AsyncValidatorFn, type ValidateStatus, type ValidatorFn, type ValidatorOptions } from '../types'
import { AbstractControl } from './abstractControl'

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export class FormArray<T = any> extends AbstractControl<T[]> {
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk/forms/src/models/formControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import { watch } from 'vue'

import { AbstractControl } from './abstractControl'
import { type AsyncValidatorFn, type ValidatorFn, type ValidatorOptions } from '../types'
import { AbstractControl } from './abstractControl'

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export class FormControl<T = any> extends AbstractControl<T> {
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk/forms/src/models/formGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { watch, watchEffect } from 'vue'

import { hasOwnProperty } from '@idux/cdk/utils'

import { AbstractControl, type GroupControls, type OptionalKeys } from './abstractControl'
import { type AsyncValidatorFn, type ValidateStatus, type ValidatorFn, type ValidatorOptions } from '../types'
import { AbstractControl, type GroupControls, type OptionalKeys } from './abstractControl'

export class FormGroup<T extends object = object> extends AbstractControl<T> {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk/resize/src/resizable/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export type ResizableHandleInstance = InstanceType<DefineComponent<ResizableHand

export type ResizableOptions = Omit<ResizablePublicProps, 'disabled' | 'is' | 'handlers'>

export type ResizableHandlePlacement = (typeof allHandlePlacements)[number]
export type ResizableHandlePlacement = typeof allHandlePlacements[number]

export interface ResizePosition {
width: number
Expand Down
2 changes: 1 addition & 1 deletion packages/cdk/scroll/src/strategy/blockScrollStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import { addClass, removeClass } from '@idux/cdk/utils'

import { ScrollStrategy } from './scrollStrategy'
import { getScrollBarSize } from '../utils'
import { ScrollStrategy } from './scrollStrategy'

export interface BlockScrollStrategyOptions {
target?: HTMLElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* found in the LICENSE file at https://github.com/IDuxFE/idux/blob/main/LICENSE
*/

import type { GetKey } from './useGetKey'
import type { VirtualScrollProps } from '../types'
import type { GetKey } from './useGetKey'
import type { VKey } from '@idux/cdk/utils'
import type { ComputedRef, Ref } from 'vue'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import type { ComputedRef, VNode } from 'vue'

import { computed, defineComponent, inject } from 'vue'

import PanelRow from './PanelRow'
import { datePanelToken } from '../token'
import PanelRow from './PanelRow'

export default defineComponent({
setup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import { computed, defineComponent, inject } from 'vue'

import PanelCell from './PanelCell'
import { datePanelToken } from '../token'
import { panelRowProps } from '../types'
import PanelCell from './PanelCell'

interface TbodyCell {
key: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { isNil } from 'lodash-es'
import { type VKey, callEmit, useControlledProp } from '@idux/cdk/utils'
import { type GetDisabledFn, type GetKeyFn } from '@idux/components/utils'

import { type MergedData, convertMergedData, convertMergedDataMap } from './useDataSource'
import { type CascaderData, type CascaderPanelProps, type CascaderProps } from '../types'
import { callChange, getParentKeys } from '../utils'
import { type MergedData, convertMergedData, convertMergedDataMap } from './useDataSource'

export interface ExpandableContext {
expandedKeys: ComputedRef<VKey[]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { isFunction } from 'lodash-es'
import { NoopArray, type VKey } from '@idux/cdk/utils'
import { type GetDisabledFn } from '@idux/components/utils'

import { type MergedData } from './useDataSource'
import { type CascaderData, type CascaderPanelProps, type CascaderSearchFn } from '../types'
import { type MergedData } from './useDataSource'

export interface SearchableContext {
searchedData: ComputedRef<MergedData[]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { isNil } from 'lodash-es'
import { NoopArray, type VKey, convertArray } from '@idux/cdk/utils'
import { type GetDisabledFn } from '@idux/components/utils'

import { type MergedData } from './useDataSource'
import { type CascaderStrategy } from '../types'
import { getChildrenKeys, getParentKeys } from '../utils'
import { type MergedData } from './useDataSource'

export interface SelectedStateContext {
resolvedSelectedKeys: ComputedRef<VKey[]>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/cascader/src/panel/OptionGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { type PropType, type VNode, computed, defineComponent, inject, normalize
import { CdkVirtualScroll, type VirtualItemRenderFn } from '@idux/cdk/scroll'
import { ɵEmpty } from '@idux/components/_private/empty'

import Option from './Option'
import { type MergedData } from '../composables/useDataSource'
import { cascaderPanelToken } from '../token'
import Option from './Option'

export default defineComponent({
props: {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/cascader/src/panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { type VKey, useControlledProp } from '@idux/cdk/utils'
import { type CascaderConfig, useGlobalConfig } from '@idux/components/config'
import { useGetDisabled, useGetKey } from '@idux/components/utils'

import OverlayOptionGroup from './OptionGroup'
import { useActiveState } from '../composables/useActiveState'
import { useDataSource } from '../composables/useDataSource'
import { useExpandable } from '../composables/useExpandable'
Expand All @@ -25,6 +24,7 @@ import { useSelectedLimit } from '../composables/useSelectedLimit'
import { useSelectedState } from '../composables/useSelectedState'
import { CASCADER_PANEL_DATA_TOKEN, type CascaderPanelContext, cascaderPanelToken } from '../token'
import { cascaderPanelProps } from '../types'
import OverlayOptionGroup from './OptionGroup'

export default defineComponent({
props: cascaderPanelProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { type ComputedRef, type Ref, watch } from 'vue'
import { useState } from '@idux/cdk/utils'
import { type DateConfig } from '@idux/components/config'

import { applyDateTime, convertToDate, isSameDateTime } from '../utils'
import { type FormatContext } from './useFormat'
import { type InputEnableStatus } from './useInputEnableStatus'
import { applyDateTime, convertToDate, isSameDateTime } from '../utils'

export interface PickerControlContext {
inputValue: ComputedRef<string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* found in the LICENSE file at https://github.com/IDuxFE/idux/blob/main/LICENSE
*/

import type { DatePickerProps, DateRangePickerProps } from '../types'
import type { PickerControlContext } from './useControl'
import type { PickerRangeControlContext } from './useRangeControl'
import type { DatePickerProps, DateRangePickerProps } from '../types'
import type { ComputedRef } from 'vue'

import { onMounted, watch } from 'vue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { type ComputedRef, type Ref, computed, watch } from 'vue'
import { convertArray, useState } from '@idux/cdk/utils'
import { type DateConfig } from '@idux/components/config'

import { compareDateTime, convertToDate, sortRangeValue } from '../utils'
import { type PickerControlContext, useControl } from './useControl'
import { type FormatContext } from './useFormat'
import { type InputEnableStatus } from './useInputEnableStatus'
import { compareDateTime, convertToDate, sortRangeValue } from '../utils'

export interface PickerRangeControlContext {
buffer: ComputedRef<(Date | undefined)[] | undefined>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/form/src/composables/useFormItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import { type VKey, hasOwnProperty } from '@idux/cdk/utils'
import { useGlobalConfig } from '@idux/components/config'
import { type Locale } from '@idux/components/locales'

import { useFormStatus } from './public'
import { FORM_ITEM_TOKEN } from '../token'
import { type FormItemProps } from '../types'
import { useFormStatus } from './public'

export function useFormItem(props: FormItemProps): {
status: ComputedRef<ValidateStatus | undefined>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/loading-bar/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { DefineComponent, PropType } from 'vue'

export const STATUS_TYPE = ['loading', 'finish', 'error'] as const

export type StatusType = (typeof STATUS_TYPE)[number]
export type StatusType = typeof STATUS_TYPE[number]

export interface LoadingBarOptions {
mask?: boolean
Expand Down
2 changes: 1 addition & 1 deletion packages/components/menu/src/contents/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { isString } from 'lodash-es'

import { useKey } from '@idux/cdk/utils'

import { coverIcon } from './Utils'
import { usePaddingLeft } from '../composables/usePaddingLeft'
import { menuItemGroupToken, menuSubToken, menuToken } from '../token'
import { menuItemProps } from '../types'
import { coverIcon } from './Utils'

export default defineComponent({
name: 'MenuItem',
Expand Down
2 changes: 1 addition & 1 deletion packages/components/menu/src/contents/MenuItemGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { isString } from 'lodash-es'

import { useKey } from '@idux/cdk/utils'

import { coverChildren, coverIcon } from './Utils'
import { usePaddingLeft } from '../composables/usePaddingLeft'
import { menuItemGroupToken, menuSubToken, menuToken } from '../token'
import { menuItemGroupProps } from '../types'
import { coverChildren, coverIcon } from './Utils'

export default defineComponent({
name: 'MenuItemGroup',
Expand Down
2 changes: 1 addition & 1 deletion packages/components/menu/src/contents/Utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import { Logger } from '@idux/cdk/utils'
import { IxIcon } from '@idux/components/icon'
import { type GetKeyFn } from '@idux/components/utils'

import { type MenuData } from '../types'
import MenuDivider from './MenuDivider'
import MenuItem from './MenuItem'
import MenuItemGroup from './MenuItemGroup'
import MenuSub from './menu-sub/MenuSub'
import { type MenuData } from '../types'

export function coverChildren(data: MenuData[] | undefined, getKetFn: GetKeyFn): VNode[] {
if (!data || data.length === 0) {
Expand Down
9 changes: 4 additions & 5 deletions packages/components/menu/src/contents/menu-sub/MenuSub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@ import {

import { debounce } from 'lodash-es'

import { type VKey, useState } from '@idux/cdk/utils'
import { useKey } from '@idux/cdk/utils'
import { type VKey, useKey, useState } from '@idux/cdk/utils'
import { ɵOverlay } from '@idux/components/_private/overlay'
import { useGlobalConfig } from '@idux/components/config'

import InlineContent from './InlineContent'
import Label from './Label'
import OverlayContent from './OverlayContent'
import { usePaddingLeft } from '../../composables/usePaddingLeft'
import { type MenuSubContext, menuItemGroupToken, menuSubToken, menuToken } from '../../token'
import { type MenuData, type MenuProps, type MenuSubProps, menuSubProps } from '../../types'
import InlineContent from './InlineContent'
import Label from './Label'
import OverlayContent from './OverlayContent'

export default defineComponent({
name: 'MenuSub',
Expand Down
4 changes: 2 additions & 2 deletions packages/components/notification/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export const notificationProviderProps = {
offset: [String, Number, Array] as PropType<string | number | (number | string)[]>,
} as const

export type NotificationType = (typeof notificationType)[number]
export type NotificationPlacement = (typeof notificationPlacement)[number]
export type NotificationType = typeof notificationType[number]
export type NotificationPlacement = typeof notificationPlacement[number]
export type NotificationNodePropKey = 'title' | 'content' | 'footer'
export type NotificationProps = ExtractInnerPropTypes<typeof notificationProps>
export type NotificationPublicProps = ExtractPublicPropTypes<typeof notificationProps>
Expand Down
2 changes: 1 addition & 1 deletion packages/components/select/src/composables/useOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ import { isFunction, isNil } from 'lodash-es'

import { type VKey, flattenNode } from '@idux/cdk/utils'

import { GetKeyFn } from './useGetOptionKey'
import { optionGroupKey, optionKey } from '../option'
import { generateOption } from '../utils/generateOption'
import { GetKeyFn } from './useGetOptionKey'

export interface FlattenedOption {
key: VKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { type ComputedRef, computed, toRaw } from 'vue'
import { type FormAccessor } from '@idux/cdk/forms'
import { type VKey, callEmit, convertArray } from '@idux/cdk/utils'

import { type FlattenedOption } from './useOptions'
import { type SelectProps } from '../types'
import { generateOption } from '../utils/generateOption'
import { type FlattenedOption } from './useOptions'

export interface SelectedStateContext {
selectedValue: ComputedRef<VKey[]>
Expand Down
6 changes: 3 additions & 3 deletions packages/components/select/src/panel/Panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ import { callEmit } from '@idux/cdk/utils'
import { ɵEmpty } from '@idux/components/_private/empty'
import { type SelectConfig, useGlobalConfig } from '@idux/components/config'

import ListBox from './ListBox'
import Option from './Option'
import OptionGroup from './OptionGroup'
import { usePanelGetOptionKey } from '../composables/useGetOptionKey'
import { useFlattenedOptions } from '../composables/useOptions'
import { usePanelActiveState } from '../composables/usePanelActiveState'
import { useSelectedState } from '../composables/usePanelSelectedState'
import { SELECT_PANEL_DATA_TOKEN, selectPanelContext } from '../token'
import { type SelectPanelProps, selectPanelProps } from '../types'
import ListBox from './ListBox'
import Option from './Option'
import OptionGroup from './OptionGroup'

export default defineComponent({
name: 'IxSelectPanel',
Expand Down
2 changes: 1 addition & 1 deletion packages/components/table/src/composables/useDataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { type ComputedRef, type Ref, computed } from 'vue'
import { type VKey } from '@idux/cdk/utils'
import { type GetKeyFn } from '@idux/components/utils'

import { type TablePagination, type TableProps } from '../types'
import { type ActiveFilter } from './useFilterable'
import { type ActiveSorter } from './useSortable'
import { type TablePagination, type TableProps } from '../types'

export function useDataSource(
props: TableProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/components/table/src/composables/useExpandable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { type ComputedRef, computed } from 'vue'

import { type VKey, callEmit, useControlledProp } from '@idux/cdk/utils'

import { type TableProps } from '../types'
import { type TableColumnMerged, type TableColumnMergedExpandable } from './useColumns'
import { type MergedData } from './useDataSource'
import { type TableProps } from '../types'

export function useExpandable(props: TableProps, flattedColumns: ComputedRef<TableColumnMerged[]>): ExpandableContext {
const expandable = computed(() =>
Expand Down
Loading

0 comments on commit 97bdafb

Please sign in to comment.