Update devDependencies, adjust .jshintrc to jsHint 2.x, use .jshintignore. Close gh-1283.

Conflicts:
	src/.jshintrc
	test/.jshintrc
This commit is contained in:
Michał Gołębiowski 2013-07-11 12:52:07 -04:00 committed by Timmy Willison
parent b7ea5c0f35
commit 4b7a0d4e0a
6 changed files with 56 additions and 54 deletions

7
.jshintignore Normal file
View File

@ -0,0 +1,7 @@
test/qunit/**
test/data/jquery-1.9.1.ajax_xhr.min.js
test/data/badcall.js
test/data/badjson.js
test/data/json_obj.js
test/data/readywaitasset.js
test/data/readywaitloader.js

View File

@ -15,7 +15,8 @@ module.exports = function( grunt ) {
} catch(e) {} } catch(e) {}
return data; return data;
}, },
srcHintOptions = readOptionalJSON("src/.jshintrc"); fs = require( "fs" ),
srcHintOptions = readOptionalJSON( "src/.jshintrc" );
// The concatenated file won't pass onevar // The concatenated file won't pass onevar
// But our modules can // But our modules can
@ -85,9 +86,7 @@ module.exports = function( grunt ) {
} }
}, },
tests: { tests: {
// TODO: Once .jshintignore is supported, use that instead. src: [ "test/**/*.js" ],
// issue located here: https://github.com/gruntjs/grunt-contrib-jshint/issues/1
src: [ "test/data/{test,testinit,testrunner}.js", "test/unit/**/*.js" ],
options: { options: {
jshintrc: "test/.jshintrc" jshintrc: "test/.jshintrc"
} }
@ -448,7 +447,7 @@ module.exports = function( grunt ) {
// Process files for distribution // Process files for distribution
grunt.registerTask( "dist", function() { grunt.registerTask( "dist", function() {
var stored, flags, paths, fs, nonascii; var stored, flags, paths, nonascii;
// Check for stored destination paths // Check for stored destination paths
// ( set in dist/.destination.json ) // ( set in dist/.destination.json )
@ -463,7 +462,6 @@ module.exports = function( grunt ) {
}); });
// Ensure the dist files are pure ASCII // Ensure the dist files are pure ASCII
fs = require( "fs" );
nonascii = false; nonascii = false;
distpaths.forEach(function( filename ) { distpaths.forEach(function( filename ) {
@ -554,8 +552,6 @@ module.exports = function( grunt ) {
// The problem is caused by the pre-uglify task. // The problem is caused by the pre-uglify task.
// Also, remove temporary files. // Also, remove temporary files.
grunt.registerMultiTask( "post-uglify", function() { grunt.registerMultiTask( "post-uglify", function() {
var fs = require( "fs" );
this.files.forEach(function( mapping ) { this.files.forEach(function( mapping ) {
var mapFileName = mapping.src[ 0 ]; var mapFileName = mapping.src[ 0 ];

View File

@ -23,15 +23,15 @@
], ],
"dependencies": {}, "dependencies": {},
"devDependencies": { "devDependencies": {
"grunt": "0.4.1", "grunt": "~0.4.1",
"grunt-compare-size": "~0.4.0", "grunt-compare-size": "~0.4.0",
"grunt-git-authors": "1.2.0", "grunt-git-authors": "~1.2.0",
"grunt-contrib-watch": "~0.4.4", "grunt-contrib-watch": "~0.4.4",
"grunt-contrib-jshint": "~0.6.0", "grunt-contrib-jshint": "~0.6.0",
"grunt-contrib-uglify": "~0.2.2", "grunt-contrib-uglify": "~0.2.2",
"gzip-js": "0.3.1", "gzip-js": "0.3.2",
"testswarm": "~1.1.0", "testswarm": "~1.1.0",
"archiver": "~0.4.2" "archiver": "~0.4.6"
}, },
"keywords": [] "keywords": []
} }

View File

@ -16,12 +16,13 @@
"evil": true, "evil": true,
"sub": true, "sub": true,
"es3": true,
"browser": true, "browser": true,
"wsh": true, "wsh": true,
"globals": { "globals": {
"jQuery": true,
"define": true, "define": true,
"module": true, "module": true
"jQuery": true
} }
} }

View File

@ -1,3 +0,0 @@
qunit/
data/badjson.js
data/jquery-1.9.1.ajax_xhr.min.js

View File

@ -20,41 +20,42 @@
"devel": true, "devel": true,
"wsh": true, "wsh": true,
"predef": [ "globals": {
"DOMParser", "DOMParser": false,
"jQuery", "QUnit": false,
"QUnit", "ok": false,
"module", "equal": false,
"ok", "asyncTest": false,
"equal", "notEqual": false,
"test", "deepEqual": false,
"asyncTest", "strictEqual": false,
"notEqual", "notStrictEqual": false,
"deepEqual", "start": false,
"strictEqual", "stop": false,
"notStrictEqual", "expect": false,
"start", "raises": false,
"stop", "ajaxTest": false,
"expect", "testIframe": false,
"raises", "testIframeWithCallback": false,
"ajaxTest", "createDashboardXML": false,
"testIframe", "createXMLFragment": false,
"testIframeWithCallback", "moduleTeardown": false,
"createDashboardXML", "testFoo": false,
"createXMLFragment", "url": false,
"moduleTeardown", "t": false,
"testFoo", "q": false,
"url",
"t", "jQuery": true,
"q", "module": true,
"amdDefined", "test": true,
"fireNative", "amdDefined": true,
"Globals", "fireNative": true,
"hasPHP", "Globals": true,
"isLocal", "hasPHP": true,
"originaljQuery", "isLocal": true,
"$", "originaljQuery": true,
"original$", "$": true,
"externalHost" "original$": true,
] "externalHost": true
}
} }