Skip to content

Files

Latest commit

 

History

History
13 lines (7 loc) · 597 Bytes

invalid-void.md

File metadata and controls

13 lines (7 loc) · 597 Bytes

Pattern: Invalid use of void

Issue: -

Description

Disallows usage of void type outside of generic or return types. If void is used as return type, it shouldn’t be a part of intersection/union type.

The void type means “nothing” or that a function does not return any value, in contra with implicit undefined type which means that a function returns a value undefined. So “nothing” cannot be mixed with any other types. If you need this - use undefined type instead.

Further Reading