When toTypeScript() is run on JavaScript or CoffeeScript files, a TypeScript version of the file is created with TypeScript Quick Fixes applied to the newly created source.
Usage
Converting JavaScript
Converting CoffeeScript
Note: When toTypeScript() is run for CoffeeScript, the source is initially converted to JavaScript using decaffeinate, then converted to TypeScript.
toTypeScript() Settings
toTypeScript provides the following configurations representing TypeScript Quick Fixes that will be run when converting files to TypeScript:
Setting name
Description
toTypeScript.inferFromUsage
Infer variable type from usage - default: true
toTypeScript.convertToAsyncFunction
Rewrite functions that use .then Promise chaining to use async and await - default: true
toTypeScript.addMissingMember
Declare missing class members - default: true
toTypeScript.forgottenThisPropertyAccess
Add this. to unresolved variables - default: true
toTypeScript.fixAwaitInSyncFunction
Add async modifier to containing functions using await - default: true