I find it oddly specific and since I am using https://typescript-eslint.io/rules/explicit-function-return-type/ in my projects I have to explicitely say false | void instead of a simple boolean with it every time there is a tooltip that should have a onShow hook condition. Passing true should work the same as void as the implementation only checks for false.
const showTooltip = false
// There has to be a condition to satisfy the void return type
function onShow(): false | void {
if (!showTooltip) {
return false
}
}
// Ideally this would work
function onShow(): boolean {
return showTooltip
}
I find it oddly specific and since I am using https://typescript-eslint.io/rules/explicit-function-return-type/ in my projects I have to explicitely say
false | void
instead of a simple boolean with it every time there is a tooltip that should have aonShow
hook condition. Passingtrue
should work the same asvoid
as the implementation only checks forfalse
.