grunt-contrib-jshint
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -17,7 +17,9 @@ # Options | ||
## jshintrc | ||
Type: `String` | ||
Type: `String` or `true` | ||
Default value: `null` | ||
If this filename is specified, options and globals defined therein will be used. The `jshintrc` file must be valid JSON and looks something like this: | ||
If set to `true`, no config will be sent to jshint and jshint will search for `.jshintrc` files relative to the flies being linted. | ||
If a filename is specified, options and globals defined therein will be used. The `jshintrc` file must be valid JSON and looks something like this: | ||
```json | ||
@@ -24,0 +26,0 @@ { |
{ | ||
"name": "grunt-contrib-jshint", | ||
"description": "Validate files with JSHint.", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"homepage": "https://github.com/gruntjs/grunt-contrib-jshint", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -1,2 +0,2 @@ | ||
# grunt-contrib-jshint v0.7.0 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-jshint.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-jshint) | ||
# grunt-contrib-jshint v0.7.1 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-jshint.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-jshint) | ||
@@ -48,7 +48,9 @@ > Validate files with JSHint. | ||
#### jshintrc | ||
Type: `String` | ||
Type: `String` or `true` | ||
Default value: `null` | ||
If this filename is specified, options and globals defined therein will be used. The `jshintrc` file must be valid JSON and looks something like this: | ||
If set to `true`, no config will be sent to jshint and jshint will search for `.jshintrc` files relative to the flies being linted. | ||
If a filename is specified, options and globals defined therein will be used. The `jshintrc` file must be valid JSON and looks something like this: | ||
```json | ||
@@ -207,2 +209,3 @@ { | ||
* 2013-10-31 v0.7.1 Ability to set jshintrc option to true to use jshint's native ability for finding .jshintrc files relative to the linted files. | ||
* 2013-10-23 v0.7.0 Update to jshint 2.3.0. | ||
@@ -235,2 +238,2 @@ * 2013-10-23 v0.6.5 Fix output when maxerr is low. | ||
*This file was generated on Wed Oct 23 2013 20:35:54.* | ||
*This file was generated on Thu Oct 31 2013 09:48:13.* |
@@ -189,19 +189,21 @@ /* | ||
// Read JSHint options from a specified jshintrc file. | ||
if (options.jshintrc) { | ||
options = jshintcli.loadConfig(options.jshintrc); | ||
delete options.jshintrc; | ||
} | ||
// Enable/disable debugging if option explicitly set. | ||
if (grunt.option('debug') !== undefined) { | ||
options.devel = options.debug = grunt.option('debug'); | ||
// Tweak a few things. | ||
if (grunt.option('debug')) { | ||
options.maxerr = Infinity; | ||
if (options.jshintrc === true) { | ||
// let jshint find the options itself | ||
delete cliOptions.config; | ||
} else if (options.jshintrc) { | ||
// Read JSHint options from a specified jshintrc file. | ||
cliOptions.config = jshintcli.loadConfig(options.jshintrc); | ||
} else { | ||
// Enable/disable debugging if option explicitly set. | ||
if (grunt.option('debug') !== undefined) { | ||
options.devel = options.debug = grunt.option('debug'); | ||
// Tweak a few things. | ||
if (grunt.option('debug')) { | ||
options.maxerr = Infinity; | ||
} | ||
} | ||
// pass all of the remaining options directly to jshint | ||
cliOptions.config = options; | ||
} | ||
cliOptions.config = options; | ||
// Run JSHint on all file and collect results/data | ||
@@ -208,0 +210,0 @@ var allResults = []; |
@@ -52,2 +52,13 @@ 'use strict'; | ||
}, | ||
passTheJshintrcBuck: function(test) { | ||
test.expect(1); | ||
var files = [path.join(fixtures, 'nodemodule.js')]; | ||
var options = { | ||
jshintrc: true | ||
}; | ||
jshint.lint(files, options, function(results, data) { | ||
test.ok(results.length === 0, 'Should not have reported any errors, .jshintrc must not have been found'); | ||
test.done(); | ||
}); | ||
}, | ||
defaultReporter: function(test) { | ||
@@ -54,0 +65,0 @@ test.expect(2); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36334
461
237