WebStorm 2018.3 EAP #5: new intentions and inspections, TypeScript 3.1

Posted on by Ekaterina Prigara

WebStorm 2018.3 Early Preview build #5 is now available!

If you’re unfamiliar with our Early Access Program or if you want to catch up on all the new features, check out the previous EAP blog posts.

Toolbox App is the easiest way to get EAP builds. You can also get notified right from the IDE when a new EAP build is available: go to Preferences | Appearance & Behavior | System Settings | Updates and select “Automatically check updates for Early Access Program”.

Download WebStorm 2018.3 EAP

Important! WebStorm EAP builds are not fully tested and might be unstable.

Without further ado, here are the new features you can and should try in this week’s EAP (build 183.3283.12).

Convert a function to a variable holding arrow function

You can now very easily convert a function to a variable that holds an arrow function. Press Alt-Enter on the name in the function definition and select the corresponding intention!

convert-to-var-and-arrow-function

The new intention also works for methods in classes. Here’s an example with a React component: substitute an arrow function for the event handler with the field, and you can now remove the binding in the constructor.

convert-to-field-with-arrow-function

Better ‘null’ and ‘undefined’ check

With the new inspection called Object in ‘null’ or ‘undefined’, WebStorm can now better detect situations when you will get a TypeError because a method is invoked on a value that is undefined or null, or it is passed to a function, or its property is used.

is-null-or-undefined

We have also improved the Unsound type guard inspection, which validates the conditions with typeof. Now it can warn you if the == null or != null check is always true or always false.

null-check-is-always-false

TypeScript 3.1

TypeScript 3.1 has been released and WebStorm now supports its new features: mappable tuple and array types, and new property assignments.
We have updated WebStorm’s bundled TypeScript to version 3.1 which was released just recently. You can select this version in Preferences | Languages and Frameworks | TypeScript.

The new intention to convert Promises to async functions, which was added in TypeScript 3.1, works in TypeScript files in WebStorm as well. Note that the compilation target in your tsconfig.json file should be set to “es6”.

typescript-3-1-async

Linting TypeScript files with ESLint

If you’re using ESLint to check your TypeScript files, we have some good news for you: now it’s possible to see ESLint errors and warnings in the .ts files in WebStorm. To get this working, you’ll need to have "parser":"babel-eslint", "parser":"typescript-eslint-parser" or “eslint-plugin-typescript” in your ESLint configuration.

If you use these parsers or the plugin but don’t want to lint TypeScript files with ESLint, add *.ts to .eslintignore.

Your WebStorm Team

Comments below can no longer be edited.

12 Responses to WebStorm 2018.3 EAP #5: new intentions and inspections, TypeScript 3.1

  1. Dennis says:

    October 6, 2018

    Now that you support fat arrow functions better, are they reordered properly, or will Webstorm still treat them as variables?

    Biggest PITA when you’re using alongside tslint

    • Dennis says:

      October 7, 2018

      Whoops, I mean “treat them as fields”, sorry about that.

      • Ekaterina Prigara says:

        October 8, 2018

        Please follow this issue for updates: https://youtrack.jetbrains.com/issue/WEB-28679

        • Dennis says:

          October 8, 2018

          Ah, I see that it’s been added to the 2018.3 release fix schedule, perfect! 🙂

  2. Dennis says:

    October 6, 2018

    Oh, and how are tslint problems treated? Error by default is just silly.

    • Ekaterina Prigara says:

      October 8, 2018

      Sorry, I’m not sure I understand the question. WebStorm highlights the errors and warning reported by TSLint based on the severity specified in the TSLint configuration file.

      • Dennis says:

        October 8, 2018

        Oh, my bad! Completely missed that tslint has a default severity, I thought that it was Webstorm that decided to treat them as errors.

        • Ekaterina Prigara says:

          October 8, 2018

          No problem!

  3. Andrey says:

    October 9, 2018

    This version completely freezes on indexing. Befor version work fine.

    Mac OS 10.14, ws-eap used cpu ~8%.

    • Ekaterina Prigara says:

      October 9, 2018

      We are not aware of this problem. Please send us the content of the IDE log folder (menu Help – Compress logs and show in finder) so that we can investigate the problem. Here’s a link to our issue tracker: https://youtrack.jetbrains.com/issues/WEB Thanks!

  4. Shaine Gordon says:

    February 6, 2019

    please update to support the new @typescript-eslint/eslint-plugin

    https://eslint.org/blog/2019/01/future-typescript-eslint

    • Ekaterina Prigara says:

      February 6, 2019

      The support for “@typescript-eslint/parser” should already be available in WebStorm 2019.1 Early Access Preview: https://www.jetbrains.com/webstorm/eap/