diff --git a/package.json b/package.json index 015f49a..2e5f7bb 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "grunt-contrib-internal": "^0.4.7", "grunt-contrib-jshint": "^0.10.0", "grunt-contrib-nodeunit": "^0.4.1", - "grunt-jscs": "^1.0.0", + "grunt-jscs": "^2.1.0", "underscore.string": "^2.3.3" }, "peerDependencies": { diff --git a/tasks/lib/livereload.js b/tasks/lib/livereload.js index 6999ac0..e45ff2c 100644 --- a/tasks/lib/livereload.js +++ b/tasks/lib/livereload.js @@ -52,7 +52,7 @@ module.exports = function(grunt) { LR.prototype.trigger = function(files) { grunt.log.verbose.writeln('Live reloading ' + grunt.log.wordlist(files) + '...'); - this.server.changed({body:{files:files}}); + this.server.changed({body: {files: files}}); }; return function(options) { diff --git a/test/tasks/helper.js b/test/tasks/helper.js index 84dd5fc..1376bcf 100644 --- a/test/tasks/helper.js +++ b/test/tasks/helper.js @@ -40,7 +40,7 @@ helper.assertTask = function assertTask(task, options) { // Return an interface for testing this task function returnFunc(runs, done) { // Spawn the node this process uses - var spawnGrunt = spawn(process.argv[0], spawnOptions, {cwd:cwd}); + var spawnGrunt = spawn(process.argv[0], spawnOptions, {cwd: cwd}); var out = ''; if (!Array.isArray(runs)) { diff --git a/test/tasks/nospawn_test.js b/test/tasks/nospawn_test.js index d0e9092..c76324d 100644 --- a/test/tasks/nospawn_test.js +++ b/test/tasks/nospawn_test.js @@ -29,7 +29,7 @@ exports.nospawn = { nospawn: function(test) { test.expect(3); var cwd = path.resolve(fixtures, 'nospawn'); - var assertWatch = helper.assertTask(['server', 'watch'], {cwd:cwd}); + var assertWatch = helper.assertTask(['server', 'watch'], {cwd: cwd}); assertWatch(function() { var write = 'var nospawn = true;'; grunt.file.write(path.join(cwd, 'lib', 'nospawn.js'), write); @@ -45,7 +45,7 @@ exports.nospawn = { interrupt: function(test) { test.expect(2); var cwd = path.resolve(fixtures, 'nospawn'); - var assertWatch = helper.assertTask('watch', {cwd:cwd}); + var assertWatch = helper.assertTask('watch', {cwd: cwd}); assertWatch([function() { var write = 'var interrupt = true;'; grunt.file.write(path.join(cwd, 'lib', 'interrupt.js'), write); diff --git a/test/tasks/patterns_test.js b/test/tasks/patterns_test.js index 5f42b13..df12884 100644 --- a/test/tasks/patterns_test.js +++ b/test/tasks/patterns_test.js @@ -26,7 +26,7 @@ exports.patterns = { negate: function(test) { test.expect(2); var cwd = path.resolve(fixtures, 'patterns'); - var assertWatch = helper.assertTask('watch', {cwd:cwd}); + var assertWatch = helper.assertTask('watch', {cwd: cwd}); assertWatch(function() { grunt.file.write(path.join(cwd, 'lib', 'sub', 'dontedit.js'), 'var dontedit = true;'); setTimeout(function() { diff --git a/test/tasks/reloadgruntfile_test.js b/test/tasks/reloadgruntfile_test.js index 401ade1..1d0c00c 100644 --- a/test/tasks/reloadgruntfile_test.js +++ b/test/tasks/reloadgruntfile_test.js @@ -32,7 +32,7 @@ exports.reloadgruntfile = { reloadgruntfile: function(test) { test.expect(3); var cwd = path.resolve(fixtures, 'multiTargets'); - var assertWatch = helper.assertTask('watch', {cwd:cwd}); + var assertWatch = helper.assertTask('watch', {cwd: cwd}); assertWatch([function() { // First edit a file and trigger the watch grunt.file.write(path.join(cwd, 'lib', 'one.js'), 'var one = true;'); diff --git a/test/tasks/watch_test.js b/test/tasks/watch_test.js index 82bb8cf..d07685c 100644 --- a/test/tasks/watch_test.js +++ b/test/tasks/watch_test.js @@ -30,7 +30,7 @@ exports.watch = { atBegin: function(test) { test.expect(1); var cwd = path.resolve(fixtures, 'atBegin'); - var assertWatch = helper.assertTask(['watch', '--debug'], {cwd:cwd}); + var assertWatch = helper.assertTask(['watch', '--debug'], {cwd: cwd}); assertWatch(function() { // noop. Does not modify any watched files. }, function(result) { @@ -43,7 +43,7 @@ exports.watch = { dateFormat: function(test) { test.expect(1); var cwd = path.resolve(fixtures, 'dateFormat'); - var assertWatch = helper.assertTask(['watch', '--debug'], {cwd:cwd}); + var assertWatch = helper.assertTask(['watch', '--debug'], {cwd: cwd}); assertWatch(function() { grunt.file.write(path.join(cwd, 'lib', 'one.js'), 'var one = true;'); }, function(result) { @@ -55,7 +55,7 @@ exports.watch = { oneTarget: function(test) { test.expect(2); var cwd = path.resolve(fixtures, 'oneTarget'); - var assertWatch = helper.assertTask(['watch', '--debug'], {cwd:cwd}); + var assertWatch = helper.assertTask(['watch', '--debug'], {cwd: cwd}); assertWatch(function() { var write = 'var test = true;'; grunt.file.write(path.join(cwd, 'lib', 'one.js'), write); @@ -70,7 +70,7 @@ exports.watch = { multiTargetsTriggerOneNotTwo: function(test) { test.expect(2); var cwd = path.resolve(fixtures, 'multiTargets'); - var assertWatch = helper.assertTask('watch', {cwd:cwd}); + var assertWatch = helper.assertTask('watch', {cwd: cwd}); assertWatch(function() { var write = 'var test = true;'; grunt.file.write(path.join(cwd, 'lib', 'one.js'), write); @@ -84,7 +84,7 @@ exports.watch = { multiTargetsSequentialFilesChangeTriggerBoth: function(test) { test.expect(2); var cwd = path.resolve(fixtures, 'multiTargets'); - var assertWatch = helper.assertTask('watch', {cwd:cwd}); + var assertWatch = helper.assertTask('watch', {cwd: cwd}); assertWatch([function() { grunt.file.write(path.join(cwd, 'lib', 'one.js'), 'var test = true;'); }, function() { @@ -99,7 +99,7 @@ exports.watch = { multiTargetsSimultaneousFilesChangeTriggerBoth: function(test) { test.expect(2); var cwd = path.resolve(fixtures, 'multiTargets'); - var assertWatch = helper.assertTask('watch', {cwd:cwd}); + var assertWatch = helper.assertTask('watch', {cwd: cwd}); assertWatch([function() { grunt.file.write(path.join(cwd, 'lib', 'one.js'), 'var test = true;'); grunt.file.write(path.join(cwd, 'lib', 'two.js'), 'var test = true;'); @@ -113,7 +113,7 @@ exports.watch = { spawnOneAtATime: function(test) { test.expect(1); var cwd = path.resolve(fixtures, 'multiTargets'); - var assertWatch = helper.assertTask('watch', {cwd:cwd}); + var assertWatch = helper.assertTask('watch', {cwd: cwd}); assertWatch(function() { grunt.file.write(path.join(cwd, 'lib', 'wait.js'), 'var wait = false;'); setTimeout(function() { @@ -128,7 +128,7 @@ exports.watch = { interrupt: function(test) { test.expect(2); var cwd = path.resolve(fixtures, 'multiTargets'); - var assertWatch = helper.assertTask('watch', {cwd:cwd}); + var assertWatch = helper.assertTask('watch', {cwd: cwd}); assertWatch(function() { grunt.file.write(path.join(cwd, 'lib', 'interrupt.js'), 'var interrupt = 1;'); setTimeout(function() { @@ -150,7 +150,7 @@ exports.watch = { failingTask: function(test) { test.expect(2); var cwd = path.resolve(fixtures, 'multiTargets'); - var assertWatch = helper.assertTask('watch', {cwd:cwd}); + var assertWatch = helper.assertTask('watch', {cwd: cwd}); assertWatch(function() { grunt.file.write(path.join(cwd, 'lib', 'fail.js'), 'var fail = false;'); }, function(result) { @@ -163,7 +163,7 @@ exports.watch = { cwd: function(test) { test.expect(2); var cwd = path.resolve(fixtures, 'multiTargets'); - var assertWatch = helper.assertTask('watch:cwd', {cwd:cwd}); + var assertWatch = helper.assertTask('watch:cwd', {cwd: cwd}); assertWatch(function() { grunt.file.write(path.join(cwd, 'lib', 'one.js'), 'var test = true;'); }, function(result) {