- Monaco editor, which powers VS Code is also beloved and very popular, which makes our editor instantly familiar to many.
Switching Script Language
Disabling TypeScript syntax checking can lead to bugs and typos that you will only discover at runtime that otherwise could have been caught during compilation. We strongly discourage using this mode.
In addition to auto-complete suggestions, the TypeScript option enables syntax checking and an import suggestion [link to the same as above] feature, which cannot be enabled without syntax checking. This is the default option for all new workspaces, except for workspaces that are created from templates, which default to TypeScript Strict mode.
Syntax checking adds compile time checks to your code to help you write less error-prone code. For example, if a typo was made and TypeScript knows about the type it's working with, a notification will be shown:
Syntax checks are not always guaranteed; TypeScript can help if the type is specified or inferred. If the type is
any (or equivalently very loose), defaults to
any—or is inferred as
any—then TypeScript has no idea what's inside and won't perform the syntax check for you, or it will potentially allow accessing any property, even if it knows what's inside if the type allows it. To make the most out of TypeScript's assistance, it's important to understand how type-inferencing works.
TypeScript Strict option enables strict mode, which turns on many additional features that force you to practice more defensive programming. The most beneficial feature of strict mode is that it forces users to start checking potentially missing properties when accessing object properties, which otherwise can blow up at the runtime if they were to be missing and you didn't explicitly check for them.
For example, the following code is valid in regular TypeScript mode but throws an error in TypeScript Strict mode because null checks are not performed and are deemed potentially unsafe:
This problem could be easily solved by simply checking if the
assignee property wasn't
We recommend switching to TypeScript Strict scripting mode to help you write less error-prone code. This is not a default option because it requires being aware of certain TypeScript features that might be too much for those trying out TypeScript for the first time.