What’s new in WebStorm

The Extract React component refactoring, new integrations with Angular CLI, better testing workflow and Node.js debugging experience, and many other improvements are available in WebStorm 2018.2.

JavaScript & TypeScript

New inspection tooltip

New inspection tooltip

The new inspection tooltip now not only shows the description of an error or warning, but also the best quick fix for it.

Press Alt-Shift-Enter to apply it or press Alt-Enter to see a full list of the available automatic fixes that WebStorm offers there.

Find unused code

Find unused code

With the new Code Coverage feature, you can find any unused code in your client-side app. Start a JavaScript Debug configuration with coverage in WebStorm, interact with your app in Chrome, and then stop the configuration. The report will show you what and how much code was used in each file and folder.

New JavaScript and TypeScript intentions

New intentions

To make you even more productive when working with JavaScript and TypeScript, WebStorm has a bunch of new intentions that are available when you press Alt-Enter. Here are just some of them: Implement interface, Create derived class, Implement members of an interface or abstract class, Generate cases for 'switch', and Iterate with 'for..of'.

TypeScript improvements

TypeScript improvements

WebStorm now supports all the new language features that were added in the latest TypeScript 2.9 and the upcoming TypeScript 3.0 releases.

In addition to that, WebStorm now offers more quick fixes provided by the TypeScript language service itself, like Annotate with type from JSDoc.

Frameworks

Extract React component

Extract and convert React component

Need to refactor your React component into two? Forget copy and paste: select the JSX code in the render method and use Refactor - Extract Component.

And with the new intentions, you can now convert React class components into functional components and back again.

Extract React component

New integrations with Angular CLI

Add features to your app with the New… | Angular Dependency… action. The IDE will use the Angular CLI ng add command which installs the dependency and updates the app with a special installation script.

You can now also generate the code with the Angular schematics defined in libraries like @angular/material using the New… | Angular Schematic… action.

Completion for events in Vue.js

Completion for events in Vue.js

In Vue templates, WebStorm now provides code completion for events. Event names are suggested after v-on: or if you use the shorthand notation @event. There’s also code completion for event modifiers.

Testing

Rerun failed tests

Rerun failed tests

When you run tests with Karma, Jest, or Mocha in WebStorm, you can now rerun only the failed tests, instead of running all the tests after you’ve made a fix.

Rerun failed tests

Diff view for Jest snapshots

If your Jest test has failed because of the mismatch in the snapshot, you can now see why using the familiar IDE side-by-side diff view.

It’s also now possible to quickly jump from the test file to the related snapshot by clicking on the new icon next to the test in the editor.

Tools

Completion for events in Vue.js

Support for Node.js on WSL

You can now use Node.js on Windows Subsystem for Linux to run and debug your Node.js application in WebStorm as well as for all other development tasks in the IDE, like running tests, using linters, and build tools.

Reconnect Node.js debugger

Reconnect Node.js debugger

Thanks to the new Reconnect automatically option in the Attach to Node.js/Chrome debug configuration, it is now easier to debug Node.js apps that use nodemon. When the node process is reloaded after the change, you don’t need to restart the debugger yourself to continue debugging.

Global file watchers

Global file watchers

You can now store the configured File Watchers in the IDE settings and use them in different projects. Before, a File Watcher could only be configured for a specific project. With File Watchers you can automatically run a command-line tool when you change or save a file in the IDE.

Other improvements:

  • New cleaner, simpler icons on the IDE toolbar and tool windows ensure readability and reduce visual clutter.
  • Run and debug your app, commit changes and update the project right from the Touch Bar on MacBook.
  • A new collection of over 50 code snippets for React development.
  • WebStorm now indexes a new Angular project two times faster, with no compromises affecting the quality of code completion and resolve.
  • You can now add custom templates for postfix completion in the JavaScript and TypeScript files.
  • With the new Drop frame action in the JavaScript and Node.js debuggers, you can re-enter a function if you missed a critical spot you would like to see again.
  • Press Alt-Enter on a line with a breakpoint and see the breakpoint-related actions in the list of intentions.
  • Support for JSON5 is now available in the files with the .json5 extension
  • JSON Schemas files are now automatically downloaded from schemastore.org and applied to your files, based on the file name.
  • You can be logged into multiple GitHub accounts.
  • New Browse Repository at Revision action allows you to explore files in your project at any given revision without a checkout.
Learn about WebStorm 2018.1

JavaScript & TypeScript

New documentation UI for JavaScript and TypeScript

New documentation UI

Meet the new, more compact and lightweight documentation popup!

It uses a more clear and consistent format to present the available information about the method’s parameters, their type and their return type in JavaScript and TypeScript. It also renders Markdown used in the JSDoc comments.

TypeScript improvements – Surround with the type guard

TypeScript improvements

In addition to the support for the latest TypeScript 2.7 features, this update improves the Implement Members action and adds the new Surround with type guard quick-fix for unresolved properties.

WebStorm now also recognizes TypeScript configuration files with names other than tsconfig.json.

Rename class and file together

Rename class and file together

Now if you run Refactor – Rename for a class, WebStorm will also suggest renaming the file and its usages if it has the same name as the class.

And if you press Alt-Enter on the name of the class, interface or type, you will see a new intention that suggests renaming the file to this name.

Code Style

Reformat with Prettier

Reformat with Prettier

With the new Reformat with Prettier action (Alt-Shift-Cmd/Ctrl-P), you can format the selected code, a file or a whole directory using Prettier.

Note that Prettier should be installed as your project dependency or globally on your machine.

Frameworks

Create a new Vue project

Create a new Vue project

You can now create new Vue projects in WebStorm using Vue CLI.

Install it by running npm install -g vue-cli, then press Create New Project – Vue.js on the IDE’s Welcome screen, and answer questions about the template and tools that you want to use in your new project.

Extract a Vue component

Extract a Vue component

Create a new Vue component from an existing one, without any copy and paste – select the part of the template and use Refactor – Extract or press Alt-Enter and select Extract Vue Component.

WebStorm will create a new single-file component, add an import for it, and pass all the data and methods to it with props.

Tools

Debugging React Native apps

Debugging React Native apps

With the updated React Native configuration, WebStorm now supports more run and debug scenarios: you can now separately configure how the bundler is started and also attach the debugger to an app that is already built and launched on a device.

Moreover, you can now debug apps that use Expo right in the IDE.

Configuring package manager

Configuring package manager

It has been made easier to configure package managers in WebStorm – in the Node.js and npm preferences, you can select between npm and Yarn and then use it to install dependencies and run scripts.

And if you open a new project with yarn.lock file, WebStorm will use Yarn in it if it’s installed.

New Node.js Debugger Console

New Node.js Debugger Console

Node.js debugger now has two console tabs – the Console tab that shows the output of the node process itself and the new Debugger Console where you can execute JavaScript, see the console.log messages, and jump to the location where console.log was called.

Version Control

Partial commits in Git

Partial commits in Git

With the support for partial Git commits you can now commit only selected changes from the file. Use checkboxes in the diff view of the Commit Changes dialog to select chunks of code you want to commit.

You can also add changed lines of code to a new changelist using actions on the editor gutter and then commit the changelist.

More Git improvements – Abort Rebase, Continue Rebase and Skip Commit

More Git improvements

In the commit details, you can now click on the commit hash to jump to this commit in the Log.

When you’re doing a rebase, there are now new Abort Rebase, Continue Rebase, and Skip Commit actions available in the Git Branches popup.

Style sheets

Completion and go to definition for classes

Completion and go to definition for classes

Cmd/Ctrl-click on the class name in HTML will now suggest navigating not only to its declaration in the compiled CSS file linked in this HTML file, but also to the Sass, SCSS or Less source.

In HTML, code completion will suggest classes and id from all style sheets if there are no matching symbols in the linked CSS file.

Other improvements:

  • If you're migrating to webpack 4, WebStorm can now check and provide completion for option names in the webpack configuration file.
  • Similar to tests, you can now run npm scripts using icons right in the editor.
  • When you copy the HTML code to JSX files, WebStorm will automatically replace class and on-event handlers with React-specific attributes.
  • New inspection in package.json will warn you if an installed version of the package doesn’t match the specified range.
  • Better code completion for SVG properties and values in CSS files.
  • You can now synchronize the IDE settings across multiple machines using your JetBrains account.
  • Support for the ECMAScript proposals: escape sequences in template strings, RegExp lookbehind assertions and named capture groups, and class fields.
  • Improved code completion and go to definition for the dynamic imports with import().
Learn about WebStorm 2017.3

JavaScript & TypeScript

New Pull Member Up refactoring

New Pull Member Up refactoring

With the new refactoring you can now move class methods up the class hierarchy – from your current JavaScript or TypeScript class to its parent class or interface.

Or if there’s no parent class yet, you can extract fields and methods to a superclass using the new Extract superclass refactoring.

Extract type alias and interface

Extract type alias and interface

The new Extract type alias refactoring for TypeScript allows you to create an alias for a complex type and automatically replace all its usages with the new name. There’s also a new intention to help you convert a type alias into an interface.

You can also create a new interface directly by using the new Extract interface refactoring.

Better code completion and documentation for JavaScript

Better code completion and documentation for JavaScript

Code completion and parameter info for the standard JavaScript objects and methods and Web APIs have improved, as these features are now powered by the TypeScript declaration files.

The documentation available via F1 now also includes a brief description for methods, which either comes from the bundled definition files or is fetched from MDN.

Multiple JavaScript versions in a project

Multiple JavaScript versions in a project

If your project uses different versions of JavaScript and you want WebStorm to complain when the ES6 or JSX syntax is used in the ECMAScript 5.1 file, you can now configure JavaScript language versions per directory in Preferences | Languages & Frameworks | JavaScript.

Frameworks

Improvements in Vue.js support

Improvements in Vue.js support

This update brings lots of improvements to WebStorm’s support for Vue.js! Code completion and navigation to the definition now work for Vue props, properties in the data object, computed properties, and methods.

Closing curly braces are now added automatically in Vue templates.

Code snippets for Vue.js

Code snippets for Vue.js

WebStorm adds a collection of code snippets for Vue. These code templates can help you save time typing some frequently used blocks of code. With a new Vue file template, you can also create new components faster.

Testing

Improved Jest integration

Improved Jest integration

Jest integration has become even better! When running tests in the IDE, you can now use Jest’s own watch mode for faster re-runs.

Run tests with coverage to see the coverage report. Then jump to the file to check what lines of code are not tested, if any.

From the test window, update failing snapshots in just one click.

Tools

Easy start with JavaScript debugger

Easy start with JavaScript debugger

To get started with the JavaScript debugger in WebStorm, now you no longer have to install the JetBrains’ Chrome extension first. Just create a new debug configuration and start it. WebStorm will open a new instance of Chrome and seamlessly attach to it.

New REST Client

New REST Client

WebStorm introduces a new way to test APIs from the IDE. Now you can write HTTP requests in an .http file and then quickly run them with the icons on the editor gutter.

Code Style

Import code style from ESLint and TSLint

Import code style from ESLint and TSLint

When you open a project, WebStorm will automatically import the supported code style rules from simple ESLint and TSLint configuration files.

If, on the other hand, your ESLint configuration file is written in JavaScript or YAML or uses `extends`, you can now import the code style from it using the Apply ESLint code style rules action.

Stylesheets

Better support for CSS

Better support for CSS

Code completion for CSS properties and values has become more precise. It has added completion suggestions for values of transform, transition, and pointer-events properties that were missing before.

Version Control

Working with multiple branches

Working with multiple branches

When you switch between branches, the IDE preserves your workspace, including the opened files, the current run configuration, and the breakpoints. This workspace will be automatically restored when you switch back to that branch.

Other improvements:

  • Imports are added automatically when you copy and paste code from one project file to another.
  • Use an alias for a system's node version instead of a specific version for tools and run configurations.
  • A new intention will now remind you to install a missing type declaration in TypeScript.
  • WebStorm now ships pre-built indices for the definition files for standard JavaScript and Web APIs, which makes projects open faster.
  • Start a Mocha run configuration with the `--watch` option, and it will re-run tests on changes using Mocha’s watch mode.
  • Now you have the option to improve code completion for JavaScript libraries with type declaration files. Press Alt-Enter on the import or require statement, and then select “Install TypeScript definitions for better type information.”
  • Use a different react-scripts version when creating and running a new project with create-react-app in the IDE.
  • Live Edit configuration was updated: to use it for HTML and CSS, enable “Update application in Chrome” in settings, install JetBrains IDE Support Chrome extension, and start a JavaScript debug session.