Javascript is what PHP should be since day 1.
ReasonML or ReScript is what JS should have been since day 1.
Easy adoption for all levels of programmers is what make it work for enterprise applications now.
I'm more on the strong-typed side of life nowadays. But otherwise I think it is a good choice. Also: HTML could be expressed in scheme as well. Scheme all the way down.
For most cases it's enough to just define interfaces, enums and maybe bundle some of this into discriminated unions. Throw in some generics for good measure. That's not a lot of work.
I've seen people do stuff like dependent types, but unless you're writing a library you don't actually need most of the type system's features.