It works simply by adding this line on the top or bottom:
/* vim:set filetype=javascript: */
There is also https://github.com/clausreinke/typescript-tools
It works simply by adding this line on the top or bottom:
You can add other options in there as well, so it's easy for others to match your indentation style for instance.