From d93e6e87da8466074ef243f30e586c0b20dd714c Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 4 Nov 2013 11:51:56 +0200 Subject: [PATCH] Add "bin/cleancss" to the JSHint command and fix the warnings. --- bin/cleancss | 10 ++++++---- package.json | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bin/cleancss b/bin/cleancss index e73ebd56..0db1805e 100755 --- a/bin/cleancss +++ b/bin/cleancss @@ -1,5 +1,7 @@ #!/usr/bin/env node +/* jshint latedef: false */ + var util = require('util'); var fs = require('fs'); var path = require('path'); @@ -48,10 +50,10 @@ var options = { target: null }; var cleanOptions = {}; -var fromStdin = !process.env['__DIRECT__'] && !process.stdin.isTTY; +var fromStdin = !process.env.__DIRECT__ && !process.stdin.isTTY; // If no sensible data passed in just print help and exit -if (!fromStdin && commands.args.length == 0) { +if (!fromStdin && commands.args.length === 0) { commands.outputHelp(); return 0; } @@ -127,7 +129,7 @@ function output(minified) { fs.writeFileSync(options.target, minified, 'utf8'); else process.stdout.write(minified); -}; +} function outputFeedback(messages, isError) { var prefix = isError ? '\x1B[31mERROR\x1B[39m:' : 'WARNING:'; @@ -135,4 +137,4 @@ function outputFeedback(messages, isError) { messages.forEach(function(message) { console.error('%s %s', prefix, message); }); -}; +} diff --git a/package.json b/package.json index cb121d2f..577ce978 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ ], "scripts": { "bench": "node ./test/bench.js", - "check": "jshint .", + "check": "jshint ./bin/cleancss .", "prepublish": "jshint .", "test": "vows" }, -- 2.34.1