Why even in strict mode TypeScript is not complaining about this
function test(firstName: string, lastName?: string): string { return firstName + " " + lastName; } test('John');
As MartinJohns said on a github issue regarding this topic
I think this would belong more to the realm of linters. This is not really a type error, it's just undesired behavior. no-base-to-string restrict-plus-operands restrict-template-expressions no-implicit-coercion
I think this would belong more to the realm of linters. This is not really a type error, it's just undesired behavior.
no-base-to-string
restrict-plus-operands
restrict-template-expressions
no-implicit-coercion
2.1m questions
2.1m answers
60 comments
57.0k users