I will take JS over writing plugins in C any day of the week. Gnome devs felt the same way. This way, they can iterate faster on plugins and extending the compositor.
With TypeScript, I would agree with you. With JavaScript, you are trading one problem for another. And why not a pleasant, modern. C++ extension API. Because I've found with large JavaScript applications, it becomes harder and harder avoid bugs that would be avoided with a good indexer/linter during development. But with JavaScript, anything can be anything so there is not much to index.
PS Thunderbird also uses quite a lot of JavaScript. The calendar WebDAV sync is JS-based.