Skip to content

Commit

Permalink
Replace string prototype colors with chalk
Browse files Browse the repository at this point in the history
  • Loading branch information
shama committed Feb 17, 2016
1 parent 4c040b1 commit 9527f8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"test": "grunt test"
},
"dependencies": {
"chalk": "^1.1.1",
"hooker": "^0.2.3",
"jshint": "~2.9.1"
},
Expand Down
5 changes: 3 additions & 2 deletions tasks/lib/jshint.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'use strict';

var path = require('path');
var chalk = require('chalk');
var jshintcli = require('jshint/src/cli');

exports.init = function(grunt) {
Expand Down Expand Up @@ -92,7 +93,7 @@ exports.init = function(grunt) {

// Only print file name once per error
if (result.file !== lastfile) {
grunt.log.writeln((result.file ? ' ' + result.file : '').bold);
grunt.log.writeln(chalk.bold(result.file ? ' ' + result.file : ''));
}
lastfile = result.file;

Expand All @@ -113,7 +114,7 @@ exports.init = function(grunt) {
// caret will line up correctly.
var evidence = e.evidence.replace(/\t/g, grunt.util.repeat(options.indent, ' '));

grunt.log.writeln(pad(e.line.toString(), 7) + ' |' + evidence.grey);
grunt.log.writeln(pad(e.line.toString(), 7) + ' |' + chalk.gray(evidence));
grunt.log.write(grunt.util.repeat(9, ' ') + grunt.util.repeat(e.character - 1, ' ') + '^ ');
grunt.verbose.write('[' + e.code + '] ');
grunt.log.writeln(e.reason);
Expand Down

1 comment on commit 9527f8f

@jurko-gospodnetic
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked it. All good. Could not find any other uses of the colors package's String.prototype extension methods. Thanks! 👍

Please sign in to comment.