Resolved ALL eslint issues for project

This commit is contained in:
2022-08-12 23:46:55 +02:00
parent 29dfe55974
commit 3594b18872
63 changed files with 1064 additions and 800 deletions

View File

@@ -1,20 +1,24 @@
<!-- eslint-disable vuejs-accessibility/click-events-have-key-events, vue/no-v-html -->
<template>
<transition name="slide">
<div v-if="show" @click="clicked" class="toast" :class="type">
<div v-if="show" class="toast" :class="type || 'info'" @click="clicked">
<div class="toast--content">
<div class="toast--icon">
<i v-if="image"><img class="toast--icon-image" :src="image" /></i>
<i v-if="image"
><img class="toast--icon-image" :src="image" alt="Toast icon"
/></i>
</div>
<div class="toast--text" v-if="description">
<div v-if="description" class="toast--text">
<span class="toast--text__title">{{ title }}</span>
<br /><span
class="toast--text__description"
v-html="description"
></span>
</div>
<div class="toast--text" v-else>
<div v-else class="toast--text">
<span class="toast--text__title-large">{{ title }}</span>
</div>
<div class="toast--dismiss" @click="dismiss">
<i class="fas fa-times"></i>
</div>
@@ -37,14 +41,7 @@
timeout?: number;
}
const {
type = "info",
title,
description,
image,
link,
timeout = 2000
} = defineProps<Props>();
const props = defineProps<Props>();
const router = useRouter();
const show: Ref<boolean> = ref(false);
@@ -53,16 +50,16 @@
show.value = true;
setTimeout(() => {
console.log("Notification time is up 👋");
console.log("Notification time is up 👋"); // eslint-disable-line no-console
show.value = false;
}, timeout);
}, props.timeout || 2000);
});
function clicked() {
show.value = false;
if (link) {
router.push(link);
if (props.link) {
router.push(props.link);
}
}
</script>

View File

@@ -6,11 +6,7 @@ const optionsDefaults = {
data: {
type: "info",
show: true,
timeout: 3000,
onCreate(created = null) {},
onEdit(editted = null) {},
onRemove(removed = null) {}
timeout: 3000
}
};
@@ -29,8 +25,8 @@ function toast(options) {
}
export default {
install(app, options) {
console.log("installing toast plugin!");
install(app) {
console.log("installing toast plugin!"); // eslint-disable-line no-console
function info(options) {
toast({ type: "info", ...options });
@@ -53,6 +49,8 @@ export default {
}
const notifications = { info, success, warning, error, simple };
/* eslint-disable-next-line no-param-reassign */
app.config.globalProperties.$notifications = notifications;
app.provide("notifications", notifications);