Import-js plugins now support atmosphere packages with mainModule (Sublime/Atom/VSCode/Vim/Emac)


#1

The latest version of Import-js — which helps you import modules — has just been updated to support atmosphere packages!

Here’s a quick example of using it to import a modules from a local package:

import-js-meteor

Also works for non-local packages, Meteor core packages, on top of the usual npm and relative imports.

Disclaimer: Not my project, but was my PR that added api.mainModule support from Meteor packages


#2

Nice tool~ I wish it supports WebStorm.


#3

Me too, my colleague uses WebStorm and always gripes about having to type out the whole import every time


#4

Can you share your importjs.js configuration?


#5

Here’s the one that I’m using at the moment, filtering out the meteor globals so that they are imported (which still doesn’t work for 'fix all imports')

const globals = require('globals');
module.exports = {
    declarationKeyword: 'import',
    environments: ['meteor', 'node'],
    globals: Object.keys(globals).filter(name => name !== 'meteor'),
    useRelativePaths: false
};