Closed nelsonvassalo closed 6 years ago
To get autocompletion from your imported files from node_modules, you need to download the flow type definitions (typescript works the same), see:https://github.com/pichillilorenzo/JavaScriptEnhancements/wiki/Adding-new-definitions-with-flow-typed
If the type definition is missing in the official flow-typed repository, then autocompletion will not show up because Flow cannot get it.
Hi
Does that mean every single library needs its own Flow type definition? Or is there s single Flow def for ‘node_modules’?
What about my custom modules, will they be autocompleted?
Thank you On 6 Jul 2018, 00:36 +0100, Lorenzo Pichilli notifications@github.com, wrote:
To get autocompletion from your imported files from node_modules, you need to download the flow type definitions (typescript works the same), see:https://github.com/pichillilorenzo/JavaScriptEnhancements/wiki/Adding-new-definitions-with-flow-typed If the type definition is missing in the official flow-typed repository, then autocompletion will not show up because Flow cannot get it. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
Does that mean every single library needs its own Flow type definition?
Yes, for example if you are using "express" in a node.js app, you will need its flow type definition to get autocompletion
What about my custom modules, will they be autocompleted?
technically, yes! But if they are in node_modules folder, then you need also here flow type definition
This is how flow (and typescript) works
So if instead of laoding a big library, like say Three.js out of the modules and into my own source folder, they’d suddenly get autocomplete?
So I came across a Typescript definitoon for these libraries. Any chance I can use that instead of the flow def?
You need to install the Typescript plugin for Sublime to work with .ts files because this plugin works only with .js files! If you are working in a typescript project, then the Typescript plugin will do the job
Expected Behavior
Autocomplete from node_modules
Actual Behavior
Empty definitions and no autocomplete for node modules
Sublime Text console logs
Screenshots
Steps to Reproduce the Problem
any => any
Specifications