Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSHint W117 inline ignore

JSHint override not being respected.

[Output]: [L59:C38] W117: 'alert' is not defined.

[Output]: /*jshint -W117 */alert("failed to load review data..");/*jshint +W117 */

-- Actual line of code:

$scope.example.$get(
    function(data){
       $scope.data =  //do something;
    }, function(message){
        /*jshint -W117 */alert("failed..");/*jshint +W117 */
});

I use these for other warnings, but W117 seems to be ignored.

like image 624
Nix Avatar asked Mar 17 '14 13:03

Nix


2 Answers

Try have them on a seperate line

/* jshint -W117 */
alert("failed..");
/* jshint +W117 */

Another option to disable the warning is to add this at the top of the file

/* global alert */
like image 126
Daniel Magnusson Avatar answered Sep 20 '22 20:09

Daniel Magnusson


alert("failed.."); //jshint ignore:line
like image 20
JeanK Avatar answered Sep 22 '22 20:09

JeanK