From 712be7d448a73e6b517f1f814fda05eb7de549d0 Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Fri, 5 Oct 2018 12:39:56 +0200
Subject: [PATCH] [fix] Better log when running jshint

---
 hooks/before_prepare/02_jshint.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/hooks/before_prepare/02_jshint.js b/hooks/before_prepare/02_jshint.js
index 992a2bfd..f74df53f 100755
--- a/hooks/before_prepare/02_jshint.js
+++ b/hooks/before_prepare/02_jshint.js
@@ -54,22 +54,22 @@ function processFiles(dir, callback) {
 }
 
 function lintFile(file, callback) {
-    console.log("Linting " + file);
+    console.log("Linting '" + file + "'");
     fs.readFile(file, function(err, data) {
         if(err) {
-            console.log('Error: ' + err);
+            console.error('Error: ' + err);
             return;
         }
         if(jshint(data.toString())) {
-            console.log('File ' + file + ' has no errors.');
-            console.log('-----------------------------------------');
+            //console.log('File ' + file + ' has no errors.');
+            //console.log('-----------------------------------------');
             callback(false);
         } else {
-            console.log('Errors in file ' + file);
+            console.error("Errors in file '" + file + "':");
             var out = jshint.data(),
             errors = out.errors;
             for(var j = 0; j < errors.length; j++) {
-                console.log(errors[j].line + ':' + errors[j].character + ' -> ' + errors[j].reason + ' -> ' +
+                console.error( " Line " + errors[j].line + ':' + errors[j].character + ' -> ' + errors[j].reason + ' -> ' +
 errors[j].evidence);
             }
             console.log('-----------------------------------------');
-- 
GitLab