Questions tagged [grunt-contrib-jshint]

a grunt plugin to validate files with JSHint.

Validate files with JSHint.

47 questions
1
vote
0 answers

Sails, grunt-contrib-watch is not working with jshint

I'm new to sails. I'm using: sails@0.10.5 grunt-contrib-watch@0.5.3 grunt-contrib-jshint@0.10.0 jshint@2.5.11 I've been starting my server using either sails lift or sails lift --verbose. According to the sails documentation grunt default is ran.…
1
vote
3 answers

How to tell JSHint to look for definitions in another JS file

Here's the problem: I'm using JSHint in Grunt. I have a couple JS files and they'll be merged into one file in the end. But before merging, I would like to run JSHint. However, JSHint complaints some undefined variables. Here's an example: 1.…
Mao
  • 107
  • 7
1
vote
0 answers

Grunt Contrib JSHint Warnings

So in our build, we use jshint to warn us of any console log errors and any other anomalies. Currently, I'm unable to build (without --force) whenever I'm using the bitwise ~ operator. I am getting the following error in verbose: >> Line 310:…
1
vote
1 answer

JSHint fails with Timer.listOnTimeout error after generating Yeoman webapp

After generating a new Yeoman webapp with yo webapp, running grunt gives a JSHint error: $ grunt Running "newer:jshint" (newer) task Running "newer:jshint:all" (newer) task Running "jshint:all" (jshint) task test/spec/test.js line 11 col 9 …
Ollie Glass
  • 19,455
  • 21
  • 76
  • 107
1
vote
2 answers

jshint exported directive not working

I've setup a mocha task in my gruntfile which loads a few test libraries before the tests start. Here is what it looks like: mochaTest: { unit: { options: { reporter: 'spec', require:…
Renaud
  • 4,569
  • 7
  • 41
  • 72
0
votes
0 answers

jsHint identifying ?. operator as an error

Has any one had success getting the new ?. operator in Javascript to pass jsHint? I have my project set up with esversion: 6 already, but I still get multiple errors. It appears that jsHint thinks it is an incorrect ternary operator. I'm aware I can…
PCasagrande
  • 5,302
  • 3
  • 27
  • 36
0
votes
0 answers

grunt is changing the paths of files defined in the Protractor Configuration file

i'm integrating my protractor tests in to grunt and i'm facing different situation with grunt.. when grunt running my configuration file it is searching for the files by changing the location. Eg: My file location i mentioned the path of the…
0
votes
1 answer

grunt-contrib-jshint not show message

i have created a ne node project, i have installed a lot of modules and create the first index.js file package.json { "name": "parser-test", "version": "1.0.0", "description": "parser test", "main": "index.js", "scripts": { "test":…
Luca Bottoni
  • 81
  • 1
  • 9
0
votes
1 answer

grunt jshint config not working

Having trouble setting up jshint options for grunt Here is my gruntfile.js grunt.initConfig( { jshint : { options: { curly: false, asi: true, eqeqeq: false, maxparams: 5, …
Pascal
  • 2,377
  • 3
  • 25
  • 40
0
votes
1 answer

Loading "Gruntfile.js" tasks...ERROR >> SyntaxError: Unexpected identifier, Task "default" not found

when I run grunt in my terminal, I got this error message, can anyone tell me why? I got an error message:Loading "Gruntfile.js" tasks...ERROR SyntaxError: Unexpected identifier Warning: Task "default" not found. Use --force to…
0
votes
1 answer

How to fail Grunt build if JSHint fails during watch task?

This seems like a basic question but I can't figure out how to do it. This is how to do it in gulp. I want when I save a file with a jshint error to fail the Grunt build. The output states that jshint failed but Grunt still completes…
Nelu
  • 16,644
  • 10
  • 80
  • 88
0
votes
3 answers

How to execute multiple targets with different options in grunt-contrib-jshint

Goal: to flex the execution of jshint to output results to the console (if in development) or to a file (if being released/in Jenkins). Is it possible? I can add individual targets to my jshint settings, but all of my options are the same except for…
whatsTheDiff
  • 658
  • 2
  • 7
  • 19
0
votes
1 answer

JShint acts differently on different machines despite same code, versions and config

I have the following JShint related modules versions on my local machine and our jenkins build machine, which runs jshint before building the UI: npm -v // 2.14.7 npm view jshint version // 2.9.2 npm view…
Daniel
  • 6,194
  • 7
  • 33
  • 59
0
votes
1 answer

Prevent JSHint's " 'a' is defined but never used. " for unused function parameters having following parameters?

// jshint unused:strict var myFunc = function(a, b, c) { return b+c; // a not used => JSHint warning: 'a' is defined but never used. }; Is there a way to disable or circumvent the warning for parameters having following parameters (in the…
RhinoDevel
  • 712
  • 1
  • 12
  • 25
0
votes
1 answer

Why does grunt.loadNpmTask('grunt-contrib-jshint') trigger an error in Sails.js?

This seems pretty straightforward, but I can't seem to debug this error. I've added this code to my Sails API as /tasks/config/jshint.js module.exports = function(grunt) { console.log(1); grunt.config.set('jshint', { files: { src:…
carpiediem
  • 1,918
  • 22
  • 41