Search code examples
javascriptwebstorm

WebStorm not remembering type hints


I'm using WebStorm with plain JavaScript. It's inferring types, but then seems to forget the type immediately. Once I call a function, it seems to pick up the type again. See the screenshot below.

Is there a way to make this work better? I'd be glad to manually provide the type hint.

enter image description here


Solution

  • Looks like you're using 'fluent-ffmpeg'. You can install TypeScript typings for it, that will improve code assistance a lot, in pure JS.

    Just add "@types/fluent-ffmpeg" to your 'devDependencies'. After npm install, WebStorm will behave much better, as it will use the typings for code assistance.