Is it possible for TypeScript compiler to detect errors in code such as this, with certain tsconfig rules in place?
function buildName(firstName: string, lastName?: string) {
return firstName + " " + lastName;
}
I believe that if there is no check in the code ensuring that lastName is not undefined, TypeScript should throw a compilation error. How can I configure tsc to catch this error during compilation?