Skip to content

Commit ec58c62

Browse files
Fix eslint warnings
1 parent 21cbd96 commit ec58c62

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

src/Tippy.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,12 @@ export default defineComponent({
3030
...commonVisibleProp,
3131
...commonProps
3232
},
33+
/* eslint-disable @typescript-eslint/no-unused-vars */
3334
emits: {
3435
attach: (instance: TippyInstance) => true,
3536
...commonEmits
3637
},
38+
/* eslint-enable @typescript-eslint/no-unused-vars */
3739
render() {
3840
return h('div', {
3941
'tippy-missing-target': this.tippyTargetMissing ? '' : undefined,
@@ -57,13 +59,10 @@ export default defineComponent({
5759
attach() {
5860
// destroy old tip
5961
if (this.tip) {
60-
try {
61-
this.singletonInstance?.remove(this.tip)
62-
this.tip.destroy();
63-
} catch (error) {
64-
console.error(error)
65-
}
66-
this.tip = undefined;
62+
const tip = this.tip
63+
this.tip = undefined
64+
this.singletonInstance?.remove(tip)
65+
tip.destroy();
6766
}
6867

6968
// find the target

src/TippyDirective.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import tippy, {Instance as TippyInstance, Props} from "tippy.js";
2-
import {Directive, DirectiveBinding, VNode} from "vue";
2+
import {Directive, DirectiveBinding} from "vue";
33

44
const _mode = Symbol("v-tippy mode")
55
type VTippyMode = 'inline' | 'target'

src/TippySingleton.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {defineComponent, h, PropType, ref, toRefs} from "vue";
1+
import {defineComponent, h, PropType, ref} from "vue";
22
import {commonEmits, commonProps, commonSetup} from "./common";
33
import {
44
createSingleton,
@@ -45,11 +45,13 @@ export default defineComponent({
4545
},
4646
...commonProps
4747
},
48+
/* eslint-disable @typescript-eslint/no-unused-vars */
4849
emits: {
4950
add: (instance: TippyInstance) => true,
5051
remove: (instance: TippyInstance) => true,
5152
...commonEmits
5253
},
54+
/* eslint-enable @typescript-eslint/no-unused-vars */
5355
render() {
5456
return h('div', {
5557
'style': 'display: none;',

src/common.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {computed, ExtractPropTypes, PropType, Ref, toRefs, watch} from "vue";
33
import {SetupContext} from "@vue/runtime-core";
44
import {injectCallback} from "./utils";
55

6+
/* eslint-disable @typescript-eslint/no-unused-vars */
67
export const commonEmits = {
78
mount: (instance: TippyInstance) => true,
89
show: (instance: TippyInstance) => true,
@@ -12,6 +13,7 @@ export const commonEmits = {
1213
trigger: (instance: TippyInstance, event: Event) => true,
1314
untrigger: (instance: TippyInstance, event: Event) => true,
1415
}
16+
/* eslint-enable @typescript-eslint/no-unused-vars */
1517

1618
export const commonProps = {
1719
/**

src/utils.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,3 @@ export function findSibling(element: Element, test: (element: Element) => boolea
5454
}
5555
return null;
5656
}
57-
58-
function matchesTarget(element: any, dataName: string, dataValue: string): boolean {
59-
return element.dataset && element.dataset[dataName] === dataValue
60-
}

0 commit comments

Comments
 (0)