grunt-contrib-jshint

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

断了今生、忘了曾经 提交于 2019-12-23 02:29:15
问题 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. JavaScript/file_one.js defines a variable: var Foo = (function (){}()); 2. JavaScript/file_two.js uses that module. new Foo(). jshint: { files: ['Gruntfile.js', 'javascript/**/*.js', ], options: { // some options. } } JSHint complaints that Foo isn't

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

别说谁变了你拦得住时间么 提交于 2019-12-08 03:40:05
问题 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 file: module.exports = function (grunt) { grunt.loadNpmTasks('grunt-shell'); grunt.loadNpmTasks('grunt-open'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks

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

情到浓时终转凉″ 提交于 2019-12-04 10:14:09
问题 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 condition. .jshintrc { "esversion": 6 } Gruntfile.js jshint : { all: ["tests/API/**/*.js"], options: { undef: true, mocha: true, node: true, jshintrc: true, esversion: 6, globals: { require: true, module: true, console: true, esversion: 6, } }, ui: ["tests

difference between globals and predef in .jshintrc?

强颜欢笑 提交于 2019-12-03 23:19:25
问题 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/ 回答1: It seems like predef is deprecated and you should use globals instead. More information here 回答2: At JSHint Doc page http://www.jshint.com/docs/ "predef" is mention for use inside .jshintrc file, wile word "globals" is used only once for inline directive (those that

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

我只是一个虾纸丫 提交于 2019-12-03 06:10:18
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 condition. .jshintrc { "esversion": 6 } Gruntfile.js jshint : { all: ["tests/API/**/*.js"], options: { undef: true, mocha: true, node: true, jshintrc: true, esversion: 6, globals: { require: true, module: true, console: true, esversion: 6, } }, ui: ["tests/UI/**/*.js"], options: { undef: true, mocha: true, node: true, jshintrc: true, esversion: 6, globals: {

difference between globals and predef in .jshintrc?

人盡茶涼 提交于 2019-12-01 02:09:28
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/ rekarnar It seems like predef is deprecated and you should use globals instead. More information here At JSHint Doc page http://www.jshint.com/docs/ "predef" is mention for use inside .jshintrc file, wile word "globals" is used only once for inline directive (those that are inside .js files) So examples would be : inside .jshintrc file "predef" : [ // Extra globals "angular