"ES6 Promise: unresolved" with flow

Webstorm notifies: Missing import statement, but it only shown when flow is working.

with flow

without flow:



Can't recreate using similar settings in 2018.3.3 - I'm not prompted to import Promise from q library regardless of JavaScript language settings:


what IDE version do you use? Can you share a sample project that can be used to recreate the issue?




I guess the problem was here...

as soon as I unchecked this checkbox the notification disappeared


But I can't recreate the issue with node_modules included in index...


I'll make a repo with empty project but all packages tomorrow. 



there are severals errors:

But it used it in pages/index.js


This is the next.js method and I've added next.js types as a library. (maybe I didn't understand how it works)


1. withInfo and withConsole modules: with Flow enabled, Webstorm uses type definitions from flow-typed when resolving types ... And both flow-typed/npm/@storybook/addon-info_vx.x.x.js and flow-typed/npm/@storybook/addon-console_vx.x.x.js are auto-generated files that don't include stubs for corresponding modules. If you change the project Javascript language version to ECMAScript 6, modules will be correctly resolved to definitions in node_modules/@storybook/addon-info/src/index.js, etc.

2. what is require.context()? it's not a part of Node.js core. Webpack method?

3. Promise: reproduced, logged as https://youtrack.jetbrains.com/issue/WEB-36906


Don't know about point 2, probably it's a part of storybook addons.

Got it about points 1 and 3.

What to do with "unused default export", for next.js files? Is it possible to desable this check for specific folder?


You can suppress this warning for statement, like:

// noinspection JSUnusedGlobalSymbols
export default class SatraApp extends App {

It's also possible to disable all JavaScript | General | Unused global symbol warnings for specific folder:

  • in Settings | Appearance & Behavior | Scopes, create a new scope with your folder excluded
  • in Settings | Editor | Inspections | JavaScript | General, choose this scope for Unused global symbol inspection

See https://www.jetbrains.com/help/webstorm/2018.3/inspections-settings.html#5, https://www.jetbrains.com/help/webstorm/2018.3/configuring-inspection-for-different-scopes.html

Please sign in to leave a comment.