[lint] Enforce @typescript-eslint/no-floating-promises (#3402)

This commit is contained in:
Chenlei Hu
2025-04-11 12:19:22 -04:00
committed by GitHub
parent 59e20964a0
commit dc5d7ea1be
60 changed files with 305 additions and 279 deletions

View File

@@ -45,10 +45,10 @@ const finishEditing = () => {
}
watch(
() => isEditing,
(newVal) => {
async (newVal) => {
if (newVal) {
inputValue.value = modelValue
nextTick(() => {
await nextTick(() => {
if (!inputRef.value) return
const fileName = inputValue.value.includes('.')
? inputValue.value.split('.').slice(0, -1).join('.')

View File

@@ -186,9 +186,9 @@ const menuItems = computed<MenuItem[]>(() =>
{
label: t('g.delete'),
icon: 'pi pi-trash',
command: () => {
command: async () => {
if (menuTargetNode.value) {
deleteCommand(menuTargetNode.value)
await deleteCommand(menuTargetNode.value)
}
},
visible: menuTargetNode.value?.handleDelete !== undefined,

View File

@@ -60,7 +60,7 @@ describe('UrlInput', () => {
})
})
wrapper.setProps({ modelValue: 'https://test.com' })
await wrapper.setProps({ modelValue: 'https://test.com' })
await nextTick()
await nextTick()
@@ -74,7 +74,7 @@ describe('UrlInput', () => {
validateUrlFn: () => Promise.resolve(true)
})
wrapper.setProps({ modelValue: 'https://test.com' })
await wrapper.setProps({ modelValue: 'https://test.com' })
await nextTick()
await nextTick()
@@ -88,7 +88,7 @@ describe('UrlInput', () => {
validateUrlFn: () => Promise.resolve(false)
})
wrapper.setProps({ modelValue: 'https://test.com' })
await wrapper.setProps({ modelValue: 'https://test.com' })
await nextTick()
await nextTick()
@@ -141,14 +141,14 @@ describe('UrlInput', () => {
}
})
wrapper.setProps({ modelValue: 'https://test.com' })
await wrapper.setProps({ modelValue: 'https://test.com' })
await nextTick()
await nextTick()
// Trigger multiple validations in quick succession
wrapper.find('.pi-spinner').trigger('click')
wrapper.find('.pi-spinner').trigger('click')
wrapper.find('.pi-spinner').trigger('click')
await wrapper.find('.pi-spinner').trigger('click')
await wrapper.find('.pi-spinner').trigger('click')
await wrapper.find('.pi-spinner').trigger('click')
await nextTick()
await nextTick()