Hey thanks, that’s actually quite cool. It could use a bit more work but I have a project I want to upgrade from Meteor “Classic” to ES6 style and I think this tool will help speed that up a lot. Out of interest, what does your .importjs.js look like ? What worked best for me was this :
module.exports = {
namedExports: {
"meteor/meteor": [
'Meteor'
],
'meteor/mongo': [
'Mongo'
],
"meteor/check": [
'Match', 'check'
],
"meteor/aldeed:simple-schema": [
"SimpleSchema"
],
'meteor/ddp': [
'DDP'
],
'meteor/templating': [
'Template'
],
"meteor/tmeasday:publish-counts": [
"Counts"
],
"meteor/mdg:validated-method": [
"ValidatedMethod"
],
"meteor/kadira:flow-router": [
"FlowRouter"
],
"meteor/random": [
"Random"
],
"meteor/http": [
"HTTP"
],
"meteor/oauth-encryption": [
"OAuthEncryption"
],
"meteor/accounts-base": [
"Accounts"
],
"meteor/promise": [
"Promise"
],
"meteor/ejson": [
"EJSON"
],
"meteor/edgee:slingshot": [
"Slingshot"
],
"meteor/kadira:blaze-layout": [
"BlazeLayout"
],
"meteor/spacebars": [
"Spacebars"
],
"meteor/jquery": [
"$"
],
"meteor/percolate:migrations": [
"Migrations"
],
"meteor/webapp": [
"WebApp", "WebAppInternals"
],
"meteor/reactive-dict": [
"ReactiveDict"
],
"meteor/reactive-var": [
"ReactiveVar"
],
"meteor/tracker": [
"Tracker"
],
"meteor/blaze": [
"Blaze"
],
"meteor/aldeed:autoform": [
"AutoForm"
]
},
danglingCommas: false,
maxLineLength: 100
}
I couldn’t see how to get it to find lodash and some other npm modules but 90% of our imports are our own code and meteor modules so this will help a lot.
Not too important but I also couldn’t see a way to remove the space before and after { nor change from single quotes to double, but ESLint fixes that straight after the Fix Imports has run.