ReSharper Web Help

Code highlighting

ReSharper recognises *.ts and *.d.ts files, and highlights source code within such files according to the predefined colors. You can change colors and fonts at any time. For more information, see Configuring Syntax Highlighting.

Code completion

As usual, you can use Code completion features to ease code writing. TypeScript is an object-oriented programming language, so we can define types and members. For example, ReSharper suggests members of the current instance after this keyword.
ReSharper_by_Language__TypeScript__Code_Completion_01
ReSharper also takes into account the right level of abstraction. Consider the example below. After a new instance of the Vector object is initialized, ReSharper displays all available members in the completion list.
ReSharper_by_Language__TypeScript__Code_Completion_02
The minus and plus methods are public, so they are in the list. The times method is private, so it is excluded from the list.

Quick-fixes

ReSharper suggests about 50 quick-fixes to fix compiler errors.

Rename function overload properly
It is a small handy fix. If you have made a typo or two in a function name, ReSharper highlights the suspicious name and suggests you the corresponding quick-fix. After applying the quick-fix, your function overloads will be properly and accurately declared.
ReSharper_by_Language__TypeScript__Quick-Fixes__rename_function_overload_01

Make public/private
The default member accessibility is public, but if you explicitly specify a function as private, then all its overloads should have the same modifier. If it is not so, ReSharper highlights that and suggests changes.
ReSharper_by_Language__TypeScript__Quick-Fixes__change_modifier_01

Add type annotation
When type is not specified, the variable is highlighted. Press Ctrl+Enter to display the list of quick-fixes and apply the following one. Necessary type annotation will be added.
ReSharper_by_Language__TypeScript__Quick-Fixes__add_annotation_01

Remove question mark
In TypeScript optional parameters can't have default values. If they by accident have, you can either remove a question mark or remove the initializer.
ReSharper_by_Language__TypeScript__Quick-Fixes__remove_question_mark_01

Remove ambient function body
There is no need to keep unnecessary constructs in your code. In attempt to make code readable, ReSharper suggests removing ambient function bodies, for example.
ReSharper_by_Language__TypeScript__Quick-Fixes__remove_function_body_01

Context actions

Create from usage
You can create declarations of symbols after they have been actually used via the corresponding context action.
ReSharper_by_Language__TypeScript__Context_Actions__create_local_variable_01
Or you can use a data type that doesn't exist yet and declare it later using the following context action.
ReSharper_by_Language__TypeScript__Quick-Fixes__create_module_01

Import type
In some other cases, there is no need to create a new entity. When, for example, you want to use an existing one and the only thing that you you haven't taken into account yet is visibility scope.
ReSharper_by_Language__TypeScript__Context_Actions__import_type_01