feat: now compliant with eslint
All checks were successful
CI / build (push) Successful in 10s

This commit is contained in:
Pierre Tellier
2025-02-09 15:28:09 +01:00
parent 8af40bfe50
commit 1dff7573ff
13 changed files with 72 additions and 65 deletions

View File

@ -1,5 +1,19 @@
import {ref} from "vue";
enum color {Red, Yellow, Blue, green}
import {type Ref} from "vue";
enum color {Red, Yellow, Blue, Green}
type ErrorMessageContent = {
message: string;
color: color;
id: number;
timeout: number;
};
let id: number = 0;
const getId = () => {
id = id+1;
return id;
}
function addNewMessage(errorMessage: string, type?: color, timeout?: number){
if (timeout == null){
@ -9,11 +23,11 @@ function addNewMessage(errorMessage: string, type?: color, timeout?: number){
type = color.Red;
}
const data = {errorMessage: errorMessage, timeout: timeout, type: type, uid: Math.random()*100000};
const data: ErrorMessageContent = {message: errorMessage, timeout: timeout, color: type, id: getId()};
errorList.value.push(data)
setTimeout(() => errorList.value.slice(0, 1), timeout)
}
const errorList: any= ref([])
const errorList: Ref<ErrorMessageContent[]>= ref([])
export {addNewMessage, errorList, color}
export {addNewMessage, errorList, color, type ErrorMessageContent}