Questions tagged [grunt-contrib-jshint]

a grunt plugin to validate files with JSHint.

Validate files with JSHint.

47 questions
34
votes
5 answers

arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6')

Currently I'm running my tests with protractor/grunt but I'm getting the follow error message: 'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6'). I think my .jshintrc file is not being read, because I've added this…
Rafael C.
  • 2,245
  • 4
  • 29
  • 45
25
votes
2 answers

difference between globals and predef in .jshintrc?

What the difference and purpose of having both of them in the .jshintrc? When I want to add a variable to be ignored, which one is the best one I should use? Also I can't find 'predef' in http://www.jshint.com/docs/options/
codeboy
  • 436
  • 5
  • 9
9
votes
1 answer

Grunt/jshint - task watcher terminal output colors

I'm using Grunt task runner to build a web app on Windows 8.1, and have JShint task for checking Javascript. The Gruntfile was generated using the Webapp generator. When JSHint detects an error, the output generated in the terminal window is colored…
zumek
  • 608
  • 6
  • 14
6
votes
4 answers

Grunt Warning: Path must be a string. Received a null

I'm getting this error when I try to compile with Grunt. I haven't used it much before but I seem to only be getting this error with this project and it works fine for other projects on my server. Running "jshint:main" (jshint) task Warning: Path…
user2953989
  • 2,791
  • 10
  • 36
  • 49
5
votes
3 answers

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){ …
Nix
  • 57,072
  • 29
  • 149
  • 198
3
votes
1 answer

jshint 'esversion: 6' issue

I'm having an issue while running the jshint task. It alerts me to add esversion: 6 to my .jshintrc file. I entered it like so: { "esversion": 6 } When that didn't work I tried adding it inline like so: /*jshint esversion: 6 */…
justcant
  • 109
  • 1
  • 10
3
votes
1 answer

javascript event function being called multiple times

I am integrating maps on a webpage with Overlapping Marker Spiderfier on google maps. I added a click listener on the marker as below. $scope.setMarkers = function() { for (var i = 0; i < $scope.markers.length; i++) { …
Sar009
  • 2,166
  • 5
  • 29
  • 48
3
votes
1 answer

Setting jshint and travis-ci for javascript project

I'm trying to setup Travis CI on one JavaScript project hosted on GitHub but I'm getting error like Loading "jshint.js" tasks...ERROR >> Error: Cannot find module 'jshint/src/cli/cli' Those are my files: Gruntfile.js module.exports =…
Dexa
  • 1,641
  • 10
  • 25
2
votes
1 answer

jshint ignore the node_modules folder

I tried to let grunt jshint scans all the js file except the files in the node_modules folder. I tried the follow configuration of grunt, it still scan all the files including the ones in node_modules. anyone know why? also can anyone explain…
eded
  • 3,778
  • 8
  • 28
  • 42
2
votes
1 answer

grunt jshint fail only if more than N errors

I am using jshint to validate my scripts with grunt. I configured it and it works correctly. The only problem is that it either pass (when there are no errors) or fails if there is at least 1 error. I am aware that I can use --force true in my…
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753
2
votes
3 answers

Error Local Npm module "jshint-stylish" not found when it exists locally (via symlink)

I have a linux symlink to a folder called node_modules in my folder with the grunt file but when I run grunt I get this: Local Npm module "jshint-stylish" not found. Is it installed? All my other npm modules work fine,any ideas? my grunt…
FutuToad
  • 2,750
  • 5
  • 36
  • 63
2
votes
1 answer

A couple of issues with JSHint: 'is defined but never used' and 'is not defined'

I have this application pretty modular and as such, JSHint is giving me the 'x' is defined but never used error. My setup goes like this: app/assets/scripts/bootstrap.js: var x = 5; app/assets/scripts/kickstart.js: console.log(x); And here's the…
rfgamaral
  • 16,546
  • 57
  • 163
  • 275
2
votes
2 answers

jshint grunt targets generate message: 0 files linted. Please check your ignored files

I have multiple jshint configurations in my gruntfile. I tested each configuration, and it works great. However, when I define a target in the gruntfile for each configuration, jshint stops working and all I can see is : 0 files linted. Please…
guy mograbi
  • 27,391
  • 16
  • 83
  • 122
1
vote
1 answer

JSHint unable to find/interpret .jshintrc file

I am using WebStorm IDE and created my angularJS project. I am also using grunt, and am using grunt-contrib-jshint. I had some options preconfigured in my .jshintrc file which were already in the angular-seed repository I used to create the…
Sahil Arora
  • 875
  • 2
  • 8
  • 27
1
vote
4 answers

How do I re-write this Javascript code to avoid JSHint warning?

I'm a newbie developing a small web application that uses HTML, JavaScript (Angular 1.5.0) & CSS. I am using Grunt to process, jslint, minify my javascript and CSS files. My Javascript code includes an SVG image created by d3.js. I'm currently…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
1
2 3 4