Questions tagged [grunt-contrib-jshint]

a grunt plugin to validate files with JSHint.

Validate files with JSHint.

47 questions
0
votes
1 answer

Is it possible to have more than one reporter & reporterOutput in jshint?

In my options, I have a reporter and reporterOutput defined on my grunt task for jshint. But I'd like to write out two files from the same data. Is it possible with jshint using the options or do I just need to define 2 grunt tasks that will do…
whatsTheDiff
  • 658
  • 2
  • 7
  • 19
0
votes
1 answer

How to specify custom reporter with JSHint

I'm using JSHint (in grunt tasks) on a project and currently have it setup to use "jshint-stylish" as the reporter. It's defined in the jshint.js file as seen in the following code module.exports = { options: { reporter:…
whatsTheDiff
  • 658
  • 2
  • 7
  • 19
0
votes
1 answer

Exclude .spec files minified by grunt-contrib-jshint

I'm using the yeoman angular generator. In this generator the test are placed in a seperate folder 'test'. I rather keep them in the same folder as my .js files. I give them the name .spec.js. I need to fix this in my Gruntfile.js file so they are…
Joe
  • 4,274
  • 32
  • 95
  • 175
0
votes
1 answer

Missing "use strict" even though it's already declared at top of file

Am getting this Missing "use strict" statement even though it's decalred at the top of the file, which confuses me. This error appears twice, for lines 10 and 12. 'user strict'; var elasticsearch = require('elasticsearch'); var client = new…
user1275105
  • 2,643
  • 5
  • 31
  • 45
0
votes
1 answer

grunt-contrib-jshint not linting errors in my code

To start with, I know that I'm doing something wrong, but grunt-contrib-jshint is not linting my JS properly, and is simply passing the files. I read the docs, but couldn't find my error. Here is a link to the branch of my basic bootstrap app where…
Ben
  • 5,085
  • 9
  • 39
  • 58
0
votes
1 answer

Can't find module hooker when run grunt jshint

When I run grunt jshint in cmd, show me below error: Loading "jshint.js" tasks...ERROR Error: Cannot find module 'hooker Warning: Task "jshint:myFiles" not found. Use --force to continue. Aborted due to warnings.` this is my code: module.exports =…
user4540007
0
votes
2 answers

Grunt installation

I am building a application with angularjs with a server, when building the backend, it is told to install grunt-contrib-jshint. I have installed grunt to my project but I have no idea why do I have to install grunt-contrib-jshint.
shamila
  • 1,280
  • 6
  • 20
  • 45
0
votes
1 answer

Grunt JSHint - Not checking indentations

I have the indent set to 4. If I remove all the indentations in a source file, JSHint doesn't fail for it. It checks everything else but the indentations. How do I get it to check for indentations? Additionally, I have installed the jshint-eclipse…
Rutwick Gangurde
  • 4,772
  • 11
  • 53
  • 87
0
votes
0 answers

grunt js-hint: write output file of errors not working

I'm trying to use grunt with jshint and jshint-log-reporter, and can't get it to write the output file. I have installed jshint and jshint-log-reporter. My Gruntfile.js looks like this: grunt.initConfig({ pkg:…
Ofer Segev
  • 5,094
  • 2
  • 22
  • 22
0
votes
1 answer

Grunt jshint disable Expected a conditional expression and instead saw an assignment

I am using grunt-contrib-jshint and it finds the following error in my JS file: line 5 col 70 Expected a conditional expression and instead saw an assignment. I know the reason of this error, but all I want is to disable it. Looking here it…
Salvador Dali
  • 214,103
  • 147
  • 703
  • 753
0
votes
1 answer

Best practice for jshint w/ grunt and handlebars templates

I am working on a web-application using node/grunt for building. I am using jshint, requirejs, and handlebars. I started with a boilerplate that runs jshint on my source code, but jshint is giving me errors for referencing pre-compiled handlebar…
baffld
  • 166
  • 7
0
votes
2 answers

JSHint: Multiple Indents?

I'm using D3 in my project. I'd love to enforce a specific indentation pattern, but due to the multiple chaining I'd like to organize my code using multiple instances of indentation. JSHint throws an error when I have something like this: var…
user393219
0
votes
2 answers

jshint expected an assignment error

// BAR CHART if (sparklineType == 'bar') { barColor = $this.data('sparkline-bar-color') || $this.css('color') || '#0000f0', sparklineHeight = $this.data('sparkline-height') || '26px', …
0
votes
1 answer

grunt jshint angular service Missing 'new' prefix when invoking a constructor

gruntfile module.exports = function(grunt) { // Project configuration. grunt.initConfig({ // This line makes your node configurations available for use pkg: grunt.file.readJSON('package.json'), banner: …
Whisher
  • 31,320
  • 32
  • 120
  • 201
0
votes
1 answer

grunt-contrib-jshint is not ignoring specified directories

I have the following folders and files: js/ lib/ jQuery.js compiled/ all.js file1.js file2.js I want JSHint to lint only file1 and file2 (without having to specify the exact files) and for it not to lint the lib folder and…
ajcw
  • 23,604
  • 6
  • 30
  • 47