Suggestion
According to the TypeScript handbook:
The never type represents the type of values that never occur. For instance, never is the return type for a function expression or an arrow function expression that always throws an exception or one that never returns; Variables also acquire the type never when narrowed by any type guards that can never be true.
Which means that function or expression that "returns" never either terminates the program prematurely or never return (i.e. infinite loop), this leads to the section of code below it never get to execute.
Examples
console.log('before') // reachable
process.exit(0) // this function returns `never` in @types/node 10.12.0
console.log('after') // should be marked as unreachable
Checklist
My suggestion meets these guidelines:
Related issues
#12825
Suggestion
According to the TypeScript handbook:
Which means that function or expression that "returns"
nevereither terminates the program prematurely or never return (i.e. infinite loop), this leads to the section of code below it never get to execute.Examples
Checklist
My suggestion meets these guidelines:
Related issues
#12825