Skip to content

Commit

Permalink
chore: lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed Apr 13, 2024
1 parent c4be7dd commit 46137cd
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 72 deletions.
1 change: 0 additions & 1 deletion common/hooks/src/manual-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export function useManualRef() {
}

return {
// eslint-disable-next-line no-sequences
get: () => (track(), value),
set: newValue => {
if (newValue === value) return
Expand Down
1 change: 0 additions & 1 deletion common/utils/tests/common.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ describe('number', () => {

it('isRegExp', () => {
expect(isRegExp(/1/)).toBe(true)
// eslint-disable-next-line prefer-regex-literals
expect(isRegExp(new RegExp('1'))).toBe(true)
expect(isRegExp({})).toBe(false)
})
Expand Down
4 changes: 2 additions & 2 deletions components/calendar/calendar-panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function isInRange(date: Date) {
hovered,
isPrev,
isNext,
isToday,
isToday: matchedToday,
disabled,
inRange
}"
Expand All @@ -334,7 +334,7 @@ function isInRange(date: Date) {
:hovered="hovered"
:is-prev="isPrev"
:is-next="isNext"
:is-today="isToday"
:is-today="matchedToday"
:disabled="disabled"
:in-range="inRange"
></slot>
Expand Down
10 changes: 3 additions & 7 deletions components/date-picker/date-panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { computed, onMounted, ref, watch } from 'vue'
import TimeWheel from './time-wheel.vue'
import { useIcons, useNameHelper } from '@vexip-ui/config'
import { range as rangeNumbers, toDate } from '@vexip-ui/utils'
import { callIfFunc, range as rangeNumbers, toDate } from '@vexip-ui/utils'
import { useRtl } from '@vexip-ui/hooks'
import { datePickerTypes } from './symbol'
Expand Down Expand Up @@ -232,13 +232,9 @@ function handleClick(event: MouseEvent) {
}
function handleShortcut(index: number) {
let { value, name } = props.shortcuts[index]
const { value, name } = props.shortcuts[index]
if (typeof value === 'function') {
value = value()
}
emit('shortcut', name, value)
emit('shortcut', name, callIfFunc(value))
}
function handleSelectDate(date: Date) {
Expand Down
13 changes: 5 additions & 8 deletions components/date-picker/time-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
usePopper,
useSetTimeout
} from '@vexip-ui/hooks'
import { USE_TOUCH, boundRange, doubleDigits } from '@vexip-ui/utils'
import { USE_TOUCH, boundRange, callIfFunc, doubleDigits } from '@vexip-ui/utils'
import { timePickerProps } from './props'
import { useColumn, useTimeBound } from './helper'
import { TIME_REG } from './symbol'
Expand Down Expand Up @@ -618,15 +618,12 @@ function handleCancel() {
}
function handleShortcut(index: number) {
let { value, name } = props.shortcuts[index]
if (typeof value === 'function') {
value = value()
}
const { value, name } = props.shortcuts[index]
const parsedValue = callIfFunc(value)
fallbackFocus()
parseValue(value)
emitEvent(props.onShortcut as (name: string, value: string | string[]) => void, name, value)
parseValue(parsedValue)
emitEvent(props.onShortcut as (name: string, value: string | string[]) => void, name, parsedValue)
finishInput()
}
Expand Down
1 change: 0 additions & 1 deletion components/pagination/tests/pagination.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ describe('Pagination', () => {
})

it('plugins', () => {
// eslint-disable-next-line no-sparse-arrays
const wrapper = mount(() => <Pagination plugins={['total', , 'size', 'jump']}></Pagination>)

expect(wrapper.find('.vxp-pagination__total').exists()).toBe(true)
Expand Down
2 changes: 1 addition & 1 deletion dev-server/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { resolve } from 'node:path'
import { existsSync, statSync } from 'node:fs'
import { existsSync } from 'node:fs'
import { readdir, stat } from 'node:fs/promises'

import { defineConfig } from 'vite'
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"@vexip-ui/stylelint-config": "^1.1.0",
"@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"@vitest/coverage-v8": "^1.4.0",
"@vitest/coverage-v8": "1.1.3",
"@vue/test-utils": "^2.4.5",
"conventional-changelog-angular": "7.0.0",
"conventional-changelog-cli": "^4.1.0",
Expand Down Expand Up @@ -200,7 +200,7 @@
"typescript": "5.4.4",
"vite": "^5.2.8",
"vite-plugin-dts": "^3.8.2",
"vitest": "^1.4.0",
"vitest": "1.1.3",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
},
Expand Down
94 changes: 45 additions & 49 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 46137cd

Please sign in to comment.