WebStorm 2017.2.2 is now available

WebStorm 2017.2.2 is now available for download on our website and in Toolbox App.

What is fixed in WebStorm 2017.2.2:

  • Support for imports with ~ in SCSS and Less when using webpack (WEB-23707 and
    WEB-25321)
  • Support for CSS Modules with Less and Sass (WEB-27344 and
    WEB-27547)
  • Emmet abbreviations for React components now expand into self-closing tags only if you add / at the end of the abbreviation  (WEB-26468)
  • Completion for React component properties when using require (WEB-27896)
  • spy-js now works with Node.js 7 and above (WEB-24103)
  • Scaling on HiDPI monitors on Windows 10 (JRE-431)
  • and over 40 other issues.

WebStorm Team

Posted in Release Announcements | Tagged | 24 Comments

How to configure code completion in full-stack JavaScript projects?

If you’re working on a full-stack JavaScript application in WebStorm, you’ve probably noticed that code completion suggests some Node.js APIs in your client-side code and DOM APIs in the Node.js code. Here’s how to fix that.

What is Library in WebStorm?

All the objects defined in your application are automatically added to the WebStorm completion suggestions, but for adding Node.js and DOM APIs as well as symbols from the project’s dependencies to the code completion WebStorm uses a mechanism called External JavaScript Libraries or just Libraries.

You can see a list of Libraries configured for your project in Preferences | Languages & Frameworks | JavaScript | Libraries.

For every library, you can configure the scope where it works in the project. And that’s exactly what we need!

Configuring HTML and Node.js Core Libraries

The library called HTML contains all DOM APIs and by default is enabled for the whole project (hence the checked icon under Enabled). And so is the Node.js Core library with Node.js APIs (we enabled it before in Preferences | Languages & Frameworks | JavaScript | Node.js and npm).

html-node-libs

Uncheck HTML and Node.js Core libraries to disable them completely for now.

Now click on the Manage Scopes… button to start the configuration. Click + and select the folders with the client-side code – now select HTML library from the drop-down list next to them.

Click + again, select the folders or files with the server-side code and enable Node.js Core library for them.

manage-lib-scope

So now items from the HTML and Node.js Core libraries are resolved and shown in the code completion only in files in these specific project folders.

In the same way, we can configure the scope of the library that is automatically created for the node_modules folder.

For specific files, we can quickly manage the libraries with the Use JavaScript Libraries action in the file context menu in the editor. For example, we can enable Node.js Core library for our webpack configuration files.

enable-lib-for-file

By the way, the IDE inspections can be configured in a similar way using scopes in Preferences | Editor | Inspections.

WebStorm Team

Posted in Tutorials | Tagged | 7 Comments

WebStorm 2017.2.1 is now available

WebStorm 2017.2.1, the bug-fix update for the recently released WebStorm 2017.2 is now available!

You can install this update using Toolbox App. If you’re using WebStorm 2017.2 or 2017.2.1 EAP, you can update directly from the IDE.

If you’re still using an earlier version, check out the new features in WebStorm 2017.2 and download it from our website.

What is fixed in WebStorm 2017.2.1:

  • Karma integration now properly sees changes when re-compiling the code (WEB-12496 and WEB-21308)
  • React render method is no longer marked as static (WEB-19028)
  • Flow: auto import now works for types (WEB-24910); support for union optional type as arrow function return type (WEB-27666)
  • Auto import for React components now works in .tsx files (WEB-20211)
  • Tab limit can again be set to 1 (IDEA-173369)
  • Errors from ESLint are now highlighted in .vue files (WEB-27868)
  • Debugging React Native apps: you can now use Chrome as a debugging backend instead of Node.js 8 (WEB-27323)

You can find a full list of addressed issues in the Release Notes.

WebStorm Team

Posted in Release Announcements | Tagged | 4 Comments

WebStorm 2017.2 released: Move symbol refactoring, import code style from ESLint, better webpack support, and more

Today we’re announcing WebStorm 2017.2  🎉

This big summer update adds powerful Move symbol refactoring, supports new code style options for JavaScript and TypeScript, improves testing with Karma and Mocha, and much more!

Here’s what you can do with the top new features in WebStorm 2017.2:

  • Import code style from an ESLint configuration.
  • Run single Karma tests and generate code coverage reports for Mocha.
  • Take advantage of code completion in JavaScript that respects the project configuration stored in your webpack.config.js file.
  • Order code inside classes with the Rearrange code action.
  • See Parameter hints and inferred type info in TypeScript.
  • Build interfaces with support for Angular Material.
  • Enjoy better code completion and navigation for Sass selectors.
  • Scope styles for single components with support for CSS Modules.

Explore all the new features of WebStorm 2017.2 on our website.


Download WebStorm 2017.2

JetBrains WebStorm Team

Posted in Release Announcements | Tagged , , , , | 47 Comments

WebStorm 2017.2 EAP, 172.3198: apply styles from ESLint, TypeScript type info

This week’s WebStorm 2017.2 EAP build (172.3198.20) is now available.

Now you can import some of the code style rules in ESLint configuration files to the IDE. In addition, we’ve improved how type info is shown in TypeScript and added an option to fold all one-line methods and functions in JavaScript and TypeScript.

You can install this WebStorm 2017.2 EAP build via Toolbox App or by downloading it on this page. It can be installed side-by-side with your stable WebStorm version. A patch update from the last week EAP build is also available.

Please share your feedback and report issues in our tracker. Thank you!

Import code style from ESLint configuration

WebStorm now allows you to import ESLint code style rules (we matched 37 ESLint rules) to the IDE’s JavaScript code style settings.

Now if you open an .eslintrc JSON file or package.json with the eslintConfig field, you’ll see the question “Apply code style from ESLint?” at the top of the editor. Click Yes to apply the matched rules to the Project code style scheme.

import-eslint

Continue reading

Posted in Early Access Preview | Tagged , , | 12 Comments

WebStorm 2017.2 EAP, 172.3095: npm install and update notifications

A new WebStorm 2017.2 EAP build (172.3095.13) makes it easier to manage project’s dependencies: the IDE will suggest you running npm install or npm update when you open a project, update it from the version control or edit package.json.

npm-update

For the full list of issues addressed in this EAP build, see the Release notes.

You can install this WebStorm 2017.2 EAP build via Toolbox App or by downloading it on this page. It can be installed side-by-side with your stable WebStorm version. A patch update from the last week EAP build is also available.

Please share your feedback and report issues on our tracker. Thank you!

Your WebStorm Team

Posted in Early Access Preview | Tagged | 12 Comments

WebStorm 2017.2 EAP, 172.2953: improved Sass support, code coverage for Mocha, CSS Modules

This week’s WebStorm 2017.2 EAP build (172.2953.12) brings support for Mocha code coverage reports, improvements in Sass and SCSS support, and more.

You can install this WebStorm 2017.2 EAP build via Toolbox App or by downloading it on this page. It can be installed side-by-side with your stable WebStorm version. A patch update from the last week EAP build is also available.

Please share your feedback and report issues on our tracker. Thank you!

Better support for Sass and SCSS nested selectors and selectors with &

For Sass and SCSS selectors created using &, WebStorm now provides code completion in HTML files, as well as navigation to the definition (with Cmd/Ctrl-Click).

scss-amp-completion

For the nested Sass and SCSS selector, you can use Navigate to the definition (Cmd/Ctrl-Click).

navigate-nested-sass

Code coverage for Mocha

Now you can see code coverage reports for Mocha tests right in the IDE.

To get started install nyc, the command-line interface for Istanbul:
npm install --save-dev nyc

Or install Istanbul itself with npm install --save-dev istanbul. We recommend using istanbul@next because it has support for ES6 and TypeScript. Make sure that Mocha is also installed and properly set up.

Now select the set of tests you’d like to run – that could a folder with test files, a test file, a suite or a specific test – then create a new Mocha run/debug configuration via Edit Configurations dialog, save it and hit the Run with coverage icon.

run-with-coverage

You can also use the test icons in the editor to quickly run a specific suite or a test with coverage.

quickly-run-with-coverage

The coverage report will open next to the editor, showing how many files were covered with tests and the percentage of covered lines in them. From the report you can jump to the file and see what lines were covered – marked green – and what lines were not covered – marked red.

coverage-report

Continue reading

Posted in Early Access Preview | Tagged , , , , | 15 Comments

WebStorm 2017.2 EAP, 172.2827: better webpack support, convert to export, breadcrumbs for JS

This week WebStorm 2017.2 EAP build (172.2827.22) brings lots of new features that we’d like you to try. Download the EAP build on this page or by using Toolbox App. A patch update from the last week EAP build is also available.

Please share your feedback and report issues on our tracker. Thank you!

Support for webpack enhanced module resolution

This update brings a huge improvement in working with projects using webpack. WebStorm now analyses the webpack configuration and provides coding assistance that respects the webpack module resolution. That means that now all the import statements in the code that use enhanced module resolution will be properly resolved.

WebStorm runs webpack under the hood when you open a project or change webpack.config.js and, thanks to the information it gets, WebStorm now properly understands the project resolve roots and resolve aliases.

Now you don’t have to manually mark the directories as Resource roots in Preferences | Directories to fix the unresolved imports – they will just work fine.

In this project react-color is an alias for the path './src/index.js'. Now WebStorm is able to properly resolve the import from react-color, provide navigation to it and completion for the exported symbols.

webpack-alias

By default WebStorm will analyse the webpack configuration file in the root of the project, but you can select another file in Preferences | Languages & Frameworks | JavaScript | Webpack. Continue reading

Posted in Early Access Preview | Tagged , , | 18 Comments

WebStorm team at the events this summer

The WebStorm team is going to attend and sponsor some events this summer. We’d be glad to meet you there!

pitercss_conf, St. Petersburg, Russia, June 16 2017

You can meet the WebStorm team at pitercss_conf.  Stop by our expo table to get a sticker and ask us questions about WebStorm and other JetBrains tools.

Fluent, San Jose, USA, June 20-22 2017

Find the JetBrains booth at the joint Fluent-Velocity conference in the Bay Area. Our colleagues from the TeamCity team we’ll be glad to meet you and give you some WebStorm stickers and keymaps.

AngularUP, Tel Aviv, Israel, June 25 2017

You can find us at this one-day conference on Angular in sunny Tel Aviv. We’ll have a booth there and we’ll be happy to talk about your experience working on Angular apps in WebStorm.

Node Summit, San Francisco, USA, July 26-27 2017

Node Summit is the first Node.js-focused conference we are going to attend. We’ll be at the JetBrains booth to answer your questions and give demos.

AngularCamp, Barcelona, Spain, July 6-7 2017

JetBrains is one of the sponsors of AngularCamp in Barcelona. Unfortunately, we won’t be at the event, but you’ll be able to find some WebStorm stickers and keymaps there.

AngularCamp has a diversity program and provides free and reduced price tickets that you can apply for till June 15.

Your WebStorm Team

Posted in Conferences & Events | Leave a comment

WebStorm 2017.1.4 is now available

WebStorm 2017.1.4 is now available for download!

You can find the full list of addressed issues in the Release notes for this update.

If you’re using WebStorm 2017.1.3, a patch update will be available later today. If you’re using an earlier version, you can download WebStorm 2017.1.4 from our website or using Toolbox App.

WebStorm Team

Posted in Release Announcements | 9 Comments