After running the TypeScript linter, I received the following error message:
Do not use Function
as a type. The Function
type accepts any function-like value, providing no type safety when calling the function. This lack of specificity can lead to common bugs. Additionally, it allows for things like class declarations, which will cause errors at runtime if not called with new
. If you require the function to accept specific arguments, it is recommended to explicitly define the function's shape. (eslint@typescript-eslint/ban-types)
I am utilizing the notify plugin from Quasar:
How can I go about resolving this error?
Here is the code snippet I am working with:
let hideNotification: Function
function showNotification () {
if (notification.value && notification.value.message !== '') {
hideNotification = $q.notify({
type: notification.value.type,
message: notification.value.message,
position: 'bottom-right',
timeout: notification.value.timeout,
actions: [{ icon: 'close', color: 'white' }]
})
void clearNotification()
}
if (notification.value.hide) {
hideNotification()
}
}
Any help would be greatly appreciated!