1
votes

TypeScript 1.8 added allowSyntheticDefaultImports flag.

I have a TypeScript project targeting es6, which afterwards gets transpiled with Babel to ES5.

Currently, WebStorm's intellisense does not recognize this flag, and thus says that using default import from a module which does not export a default is disallowed. This means that I am not getting the definitions correctly..

Since I do not want to update all of the definition files manually, is there any other way to 'teach' WebStorm this rule, until JetBrains officially release a new version which supports it (I already submitted a ticket there).

1
no, there is no way to 'teach' the parser to treat arbitrary stuff as a default module and provide the completion - lena

1 Answers

1
votes

WebStorm doesn't appear to use the TypeScript language service, so there isn't any way that I'm aware of to fix this.

In the mean time you can use non-ES6 style imports:

import foo = require("foo");

which should basically compile down to:

var foo = require("foo");