| ▲ | morshu9001 3 hours ago | |||||||
Valid JS is often not valid TS. Any nontrivial amount of JS copied into TS will generally not work without tweaks. When people say TS is a superset of JS, it's just some academic definition of syntax supersets that isn't practically true. Non-exhaustive examples: | ||||||||
| ▲ | ddtaylor an hour ago | parent | next [-] | |||||||
The amount of weird TS I see that attempts to keep the JS style of code while getting the compiler to stop being mad is strange. I will see hundreds of line of type inference work, when they could have just made an actual type. | ||||||||
| ||||||||
| ▲ | anematode 2 hours ago | parent | prev [-] | |||||||
Even syntactically, TS is not a superset of JS: https://anemato.de/blog/js-to-ts | ||||||||
| ||||||||