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
1.4m articles
1.4m replys
5 comments
57.0k users