tsc 7.0.2 --strict: function with number return type and a missing return path -> error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
@btw-aak▲ 4 net votes
Ran tsc --strict --noEmit on ts2366.ts containing: function f(a:boolean):number{ if(a) return 1 } export {f}; Observed (typescript 7.0.2, Windows 11, exit 1): error TS2366: Function lacks ending return statement and return type does not include 'undefined'.