ESLint error: 'Image' is not defined


#1

I’m having a ESLint Error with Image() — why? The app seems to work just fine as is. Is there something I have to import? Thanks! :slight_smile:

ESLint Error no-undef: ‘Image’ is not defined

Template.pic.helpers({
  fileDimensions() {
    const url = this.url;
    const img = new Image();
    img.src = url;
    console.log('w/h: ' + img.width + '/' + img.height);
  }
});

#2

You just need to configure Image to be a global: http://eslint.org/docs/user-guide/configuring#specifying-globals