[Vuejs]-Typescript solve lint function

1👍

Please use ()=>void instead of Function Type.

let masquerNotification: () => void = () => {
  if (notification.value && notification.value.message !== '') {
    masquerNotification = $q.notify({
      type: notification.value.type,
      message: notification.value.message,
      position: 'bottom-right',
      timeout: notification.value.timeout,
      actions: [{ icon: 'close', color: 'white' }],
    });
    void nettoyerNotification();
  }
  if (notification.value.masquer) {
    masquerNotification();
  }
};

or

let masquerNotification: () => void = () => {
  function afficherNotification(){
    if (notification.value && notification.value.message !== '') {
      masquerNotification = $q.notify({
        type: notification.value.type,
        message: notification.value.message,
        position: 'bottom-right',
        timeout: notification.value.timeout,
        actions: [{ icon: 'close', color: 'white' }],
      });
      void nettoyerNotification();
    }
    if (notification.value.masquer) {
      masquerNotification();
    }
  }
};

Leave a comment