Meteor 1.3 Force error on missing package import

I am starting to migrate a project to Meteor 1.3 and importing / exporting my files the es6 way.
I do not have issue for my project files that need to imported to be executed:
If my project contains a file imports/feature.js the code inside it will have to be imported to be executed.

My problem is for the meteor packages that are included in the project and on the global scope.
How can I force a declaration of the import in my files ?
The idea would be to prevent using the variable from the global scope.

Let’s see an example with feature.js:

`import ‘./feature.html’;
import { Meteor } from ‘meteor/meteor’;
import { Template } from ‘meteor/templating’;

Template.feature.onCreated(function() {
console.log(“feature is created”, Meteor.userId());
});
`
Here my code does import the required object Meteor and Template inside the scope of my file.
At the moment, the code would work perfectly without importing { Meteor } and { Template }, do you know of an eslint rule to display an error if the imports were missing ?

Thanks

1 Like