From: XhmikosR Date: Sun, 6 Jul 2014 11:38:55 +0000 (+0300) Subject: Lint benchmark.js too. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=71b2be9c71b15bedd0f3f9cc7abe55dbfebccb31;p=html-minifier.git Lint benchmark.js too. --- diff --git a/Gruntfile.js b/Gruntfile.js index e3cc148..79904ff 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,6 +28,9 @@ module.exports = function(grunt) { }, web: { src: 'assets/master.js' + }, + other: { + src: 'benchmark.js' } }, @@ -46,6 +49,9 @@ module.exports = function(grunt) { },*/ web: { src: '<%= jshint.web.src %>' + }, + other: { + src: '<%= jshint.other.src %>' } }, diff --git a/benchmark.js b/benchmark.js index 77e0617..4103d1c 100644 --- a/benchmark.js +++ b/benchmark.js @@ -1,3 +1,5 @@ +/* jshint strict:false */ + var fs = require('fs'), exec = require('child_process').exec, Table = require('cli-table'), @@ -52,7 +54,7 @@ function test(fileName, done) { console.log('Processing...', fileName); - exec(command, function (error, output) { + exec(command, function () { fs.stat(minifedFilePath, function (err, stats) { var time = new Date() - startTime; @@ -64,8 +66,8 @@ function test(fileName, done) { table.push([ fileName, - '\033[91m' + beforeSize + '\033[0m (' + (beforeSize/1024).toFixed(2) + 'KB)', - '\033[92m' + stats.size + '\033[0m (' + (stats.size/1024).toFixed(2) + 'KB)', + '\033[91m' + beforeSize + '\033[0m (' + (beforeSize / 1024).toFixed(2) + 'KB)', + '\033[92m' + stats.size + '\033[0m (' + (stats.size / 1024).toFixed(2) + 'KB)', '\033[96m' + savingsPercent.toFixed(2) + '\033[0m% (' + savings.toFixed(2) + 'KB)', '\033[96m' + time + '\033[0mms' ]);