3 ms·
I prefer JavaScript's idiomatic approach: import anyNamespace from 'module.js' import { subModule } from 'module.js' import { subModule as anyName } from
by soulofmischief 4y ago
I prefer JavaScript's idiomatic approach:
import anyNamespace from 'module.js'
import { subModule } from 'module.js'
import { subModule as anyName } from 'module.js'
- rtpg 4y agothe biggest problem with JS's is extremely incidental, but a total mess in practice. If you type from left to right it's impossible for auto-complete to help you with member names (since it can't know what module you're looking for!)
- soulofmischief 4y agoI work around this in two ways: A) I type "import {} from 'module" first and then go back and add modules or more often these days, B) I let Copilot guess for me, which combined with my predictable file organization usually results in the right autocomplete. Option A can be improved upon by writing a macro/template with slots in the correct order.