If you're looking to achieve a similar functionality as described above, there may be an existing plugin available on PackgeControl that can help. However, I'm not currently aware of any specific plugins and the website seems to be unresponsive at this time.
In the meantime, one way to accomplish this is by using a simple plugin code like the one below:
import sublime
import sublime_plugin
class FormatTypescriptOnSave(sublime_plugin.EventListener):
def on_pre_save(self, view):
if "TypeScript" in view.settings().get("syntax"):
view.run_command("typescript_format_document")
To implement this, go to
Tools > Developer > New Plugin...
in the menu, replace the contents with the provided code snippet, and save it with any name and extension.
This code will trigger a command when a file is about to be saved, specifically for TypeScript files based on the current syntax setting.