This feature is only supported in the Ultimate edition.
IntelliJ IDEA supports developing and running TypeScript
source code. IntelliJ IDEA recognizes *.ts files and provides full
range of coding assistance for editing them without any additional steps from your side. TypeScript files are marked with
the
icon.
TypeScript-aware coding assistance includes completion for for keywords, labels, variables, parameters, and functions, error and syntax highlighting, formatting, numerous code inspections and quick-fixes, as well as common and TypeScript-specific refactoring. IntelliJ IDEA also verifies and compiles TypeScript into JavaScript on the fly.
Before you start
- Make sure the JavaScript Support plugin is enabled. The plugin is activated by default. If the plugin is disabled, enable it on the Plugins Settings page as described in Enabling and Disabling Plugins.
- Make sure the Node.js plugin is installed and enabled. The plugin is not bundled with IntelliJ IDEA, but it can be installed from the JetBrains plugin repository as described in Installing, Updating and Uninstalling Repository Plugins and Enabling and Disabling Plugins.
Verifying TypeScript and compiling it into JavaScript
IntelliJ IDEA verifies TypeScript code mainly based on the data from the
TypeScript Language Service
which also compiles TypeScript into JavaScript. All the detected syntax and compilation errors are reported
in the Errors and Compile errors tabs
of the TypeScript Tool Window.
For each error, IntelliJ IDEA provides a brief description
and information about the number of the line where it occurred.
The Console tab shows the log of the TypeScript Language Service since the tool window was opened.
To configure integration with the TypeScript Language Service
- In the Settings/Preferences dialog (Ctrl+Alt+S), click TypeScript under Languages and Frameworks. The TypeScript page opens.
- Select the TypeScript Language Service checkbox.
-
Use the controls below to configure the behaviour of the TypeScript Language Service
and enable or disable integration with the Angular language service
.
-
In the Options field,
specify the command line options to be passed to the TypeScript Language Service when the
tsconfig.jsonfile is not found. See the list of acceptable options at TSC arguments
.
Note that the -wor--watch(Watch input files) option is irrelevant.
By default, integration with the TypeScript Language Service is turned on.
To monitor syntax errors
Open the TypeScript tool window ()
and switch to the Errors tab.
The tab lists the discrepancies in the code detected by the TypeScript Language Service. The list is updated dynamically as you change your code.
-
By default, the list contains only the errors from the file in the active editor tab and the full path to this file is displayed at the top.
To show the errors across the entire project, press the Show project errors toggle button
on the toolbar.
The tab shows error messages grouped by files in which they were detected.

-
To navigate to the code in question, double-click the corresponding error message or select it
and choose Jump to Source on the context menu.

To monitor compilation errors
Open the TypeScript tool window ()
and switch to the Compile errors tab.
The tab lists the errors that occurred during compilation.
- IntelliJ IDEA updates the list as soon as your code is recompiled. If the Recompile on changes checkbox on the TypeScript page is selected, the list is updated as you edit your code. To change this setting, clear the Recompile on changes checkbox.
-
By default, the list contains only the errors from the file in the active editor tab.
To view the compilation errors across the entire compilation scope, click
on the toolbar and choose Compile All from the list.
The error messages are shown grouped by files in which they were detected.
The default compilation scope is entire project. To change this default settings, choose the relevant scope from the Compile scope list on the TypeScript page.
-
To navigate to the code in question, double-click the corresponding error message or select it
and choose Jump to Source on the context menu.

Viewing parameter hints
Parameter hints show the names of parameters in methods and functions to make your code easier to read. By default parameter hints are shown only for values that are literals or function expressions but not for named objects.

To show parameter hints for all arguments
- In the Settings/Preferences dialog box (Ctrl+Alt+S), choose General under Editor, then choose Appearance. The Appearance page opens.
- Click Configure next to the Show parameter name hint checkbox (the checkbox is selected by default).
- In the Configure Parameter Name Hints dialog that opens, select the Show name for all arguments checkbox in the Options area.
Viewing inferred type information
To see the inferred type
of an object,
hold ⌘ on macOS
or Ctrl on Windows and Linux and hover the mouse pointer over it:

Using JavaScript libraries in TypeScript
When working with JavaScript libraries in TypeScript,
you need to install type declarations
for them.
IntelliJ IDEA reminds you to install them via npm and updates your package.json file accordingly.
To install the type declarations
- Position the cursor at the warning and press Alt+Enter.
- Select the suggestion and press Enter.

Refactoring TypeScript
IntelliJ IDEA provides both common refactoring procedures, such as rename/move, etc. TypeScript-specific refactoring procedures, such as change signature, extract parameter, extract variable. See Rename Refactorings, Move Refactorings, and Refactoring TypeScript for details.
See also Refactoring JavaScript.
Generating code
IntelliJ IDEA supports the following TypeScript-aware code generation functionality:
- Generating code stubs based on file templates during file creation.
- Ability to create line and block comments (Ctrl+Slash/Ctrl+Shift+Slash).
- Generating
importstatements for modules, classes, and any other symbols that can be exported and called as a type. See Importing TypeScript Symbols. - Configuring automatic insertion or skipping the public access modifier in generated code.
Learn more from Generating Code.