chore(deps): bump to vue3.4 (#5640)

* chore(deps): bump to vue3.4

Signed-off-by: Sepush <sepush@outlook.com>

* fix: open no-use-var rule and fix lint test

Signed-off-by: Sepush <sepush@outlook.com>

---------

Signed-off-by: Sepush <sepush@outlook.com>
This commit is contained in:
Artea 2024-01-29 21:58:36 +08:00 committed by GitHub
parent 9bab7ededc
commit b3cad89bcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 59 additions and 71 deletions

View File

@ -93,10 +93,10 @@
"@vicons/ionicons4": "^0.12.0",
"@vicons/ionicons5": "^0.12.0",
"@vitejs/plugin-vue": "^5.0.3",
"@vue/compiler-sfc": "^3.3.4",
"@vue/compiler-sfc": "^3.4.15",
"@vue/eslint-config-standard": "^8.0.1",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/server-renderer": "~3.3.4",
"@vue/server-renderer": "~3.4.15",
"@vue/test-utils": "^2.4.1",
"autoprefixer": "^10.4.15",
"babel-jest": "^29.6.4",
@ -135,9 +135,9 @@
"typescript": "5.3.3",
"vfonts": "^0.0.3",
"vite": "^5.0.4",
"vue": "~3.3.4",
"vue": "~3.4.15",
"vue-router": "^4.2.4",
"vue-tsc": "^1.8.10"
"vue-tsc": "^1.8.27"
},
"peerDependencies": {
"vue": "^3.0.0"

View File

@ -1,4 +1,4 @@
import { h } from 'vue'
import { h, Fragment } from 'vue'
import { mount, type VueWrapper } from '@vue/test-utils'
import { NCheckbox, NCheckboxGroup } from '../index'
import { NForm, NFormItem } from '../../form'
@ -58,28 +58,23 @@ describe('n-checkbox', () => {
const onUpdateChecked1: (value: string) => void = () => {}
const onUpdateChecked2: (value: number) => void = () => {}
const onUpdateChecked3: (value: boolean) => void = () => {}
let _ = (
<Fragment>
<NCheckbox
onUpdateChecked={onUpdateChecked1}
checked={'123'}
defaultChecked={'123'}
/>
)
_ = (
<NCheckbox
onUpdateChecked={onUpdateChecked2}
checked={123}
defaultChecked={123}
/>
)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_ = (
<NCheckbox
onUpdateChecked={onUpdateChecked3}
checked={true}
defaultChecked={false}
/>
)
</Fragment>
})
it('should work with `indeterminate` prop', () => {

View File

@ -444,7 +444,7 @@ export default defineComponent({
class: [className, `${mergedClsPrefix}-dropdown`, this.themeClass],
clsPrefix: mergedClsPrefix,
tmNodes: this.tmNodes,
style: [...style, this.cssVars as any],
style: [...style, this.cssVars],
showArrow: this.showArrow,
arrowStyle: this.arrowStyle,
scrollable: this.scrollable,

View File

@ -297,7 +297,6 @@ describe('n-dropdown', () => {
})
it('should accept empty object in type-checking phase', () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const dropdown = <NDropdown options={[{}]} />
;<NDropdown options={[{}]} />
})
})

View File

@ -10,7 +10,7 @@
v-model:value="model.dynamicInputValue"
item-style="margin-bottom: 0;"
:on-create="onCreate"
#="{ index, value }"
#="{ index }"
>
<div style="display: flex">
<!--

View File

@ -10,7 +10,7 @@
v-model:value="model.dynamicInputValue"
item-style="margin-bottom: 0;"
:on-create="onCreate"
#="{ index, value }"
#="{ index }"
>
<div style="display: flex">
<!--

View File

@ -75,7 +75,7 @@ export default defineComponent({
`${mergedClsPrefix}-layout-footer--${this.position}-positioned`,
this.bordered && `${mergedClsPrefix}-layout-footer--bordered`
]}
style={this.cssVars as any}
style={this.cssVars}
>
{this.$slots}
</div>

View File

@ -80,7 +80,7 @@ export default defineComponent({
`${mergedClsPrefix}-layout-header--${this.position}-positioned`,
this.bordered && `${mergedClsPrefix}-layout-header--bordered`
]}
style={this.cssVars as any}
style={this.cssVars}
>
{this.$slots}
</div>

View File

@ -629,7 +629,7 @@ export default defineComponent({
finalResponsive && `${mergedClsPrefix}-menu--responsive`,
this.mergedCollapsed && `${mergedClsPrefix}-menu--collapsed`
]}
style={this.cssVars as any}
style={this.cssVars}
>
{finalResponsive ? (
<VOverflow

View File

@ -337,8 +337,7 @@ describe('n-menu', () => {
})
it('should accept empty object in type-checking phase', () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const menu = <NMenu options={[{}]} />
;<NMenu options={[{}]} />
})
it('should work with `defaultExpandedKeys` props', async () => {
@ -384,40 +383,37 @@ describe('n-menu', () => {
})
it('accepts proper options', () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const menu = (
<NMenu
options={[
{
type: 'divider'
},
{
type: 'group',
key: 'foo'
},
{
key: 'blabla',
label: 'kirby'
},
{
key: 'xxxx',
children: [
{
type: 'divider'
},
{
type: 'group',
key: 'foo1'
},
{
key: 'blabla1',
label: 'kirby'
}
]
}
]}
/>
)
;<NMenu
options={[
{
type: 'divider'
},
{
type: 'group',
key: 'foo'
},
{
key: 'blabla',
label: 'kirby'
},
{
key: 'xxxx',
children: [
{
type: 'divider'
},
{
type: 'group',
key: 'foo1'
},
{
key: 'blabla1',
label: 'kirby'
}
]
}
]}
/>
})
it('should work with `hidden` prop', async () => {

View File

@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
import { type CSSProperties, h } from 'vue'
import { type CSSProperties, h, Fragment } from 'vue'
import { NSwitch } from '../index'
describe('n-switch', () => {
@ -36,24 +36,19 @@ describe('n-switch', () => {
const onUpdateValue1: (value: string) => void = () => {}
const onUpdateValue2: (value: number) => void = () => {}
const onUpdateValue3: (value: boolean) => void = () => {}
let _ = (
<Fragment>
<NSwitch
onUpdateValue={onUpdateValue1}
value={'123'}
defaultValue={'123'}
/>
)
_ = (
<NSwitch onUpdateValue={onUpdateValue2} value={123} defaultValue={123} />
)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_ = (
<NSwitch
onUpdateValue={onUpdateValue3}
value={true}
defaultValue={false}
/>
)
</Fragment>
})
it('should work with `round` prop', async () => {

View File

@ -778,7 +778,7 @@ export default defineComponent({
this.dragOver && `${mergedClsPrefix}-upload--drag-over`,
this.themeClass
]}
style={this.cssVars as any}
style={this.cssVars}
>
{inputNode}
{this.showTrigger && this.listType !== 'image-card' && (

View File

@ -466,7 +466,6 @@ describe('match-type', () => {
describe('test type', () => {
it('works', () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = <NUpload onError={() => {}} onFinish={() => {}} />
;<NUpload onError={() => {}} onFinish={() => {}} />
})
})

View File

@ -131,7 +131,6 @@ const cancelIcon = (
</svg>
)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const retryIcon = (
<svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g stroke="none" stroke-width="1" fill-rule="evenodd">
@ -150,7 +149,6 @@ const retryIcon = (
</svg>
)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const toIcon = (
<svg viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
@ -207,6 +205,10 @@ function to (): VNode {
return toIcon
}
function retry (): VNode {
return retryIcon
}
export const icons = {
clear,
success,
@ -215,5 +217,6 @@ export const icons = {
attach,
trash,
cancel,
to
to,
retry
}

View File

@ -9,13 +9,14 @@
"jsxFactory": "h",
"jsxFragmentFactory": "Fragment",
"noImplicitAny": true,
"noUnusedLocals": false,
"noUnusedLocals": true,
"module": "ES6",
"moduleResolution": "Node",
"declaration": true,
"forceConsistentCasingInFileNames": true,
"composite": true,
"target": "ES6",
"types": ["vue/jsx","jest"],
"esModuleInterop": true,
"lib": ["ESNext", "DOM"]
}