How to prevent '... is not defined' warning


#1

I’m using the ember-cli-chart library. I’m able to set global configurations like this:

setGlobalChartConfig: Ember.on('init', function() {
  Chart.defaults.global.animation = false;
})

But ofcourse this will render this message:

controllers/application.js: line 6, col 5, 'Chart' is not defined.

What’s the best way to prevent this message from showing?


'Promise' is not defined
#2

Try to add Chart as predef in your .jshintrc.

"predef": [
    "document",
    "window",
    "-Promise",
    "$",
    "jQuery",
    "Chart"
  ],

#3

That’s it! Thank you.