Instead of
alert('message')
you should use
window.alert('message');
Because this method is defined in window object.
This of course assumes you have browser option set to true in your .jshintrc, so this way jshint will know window object is exposed.
"browser" : true, // Standard browser globals e.g. window, document.
*The same thing happens with confirm().