requirement: TypeScript package should be installed
Step 1: Create a new plugin (Tools > Developer > new plugin) with the following, save it as format-on-save.py
for example:
import sublime
import sublime_plugin
class FormatTypescriptOnSave(sublime_plugin.EventListener):
def on_pre_save(self, view):