Skip to content

Commit

Permalink
tools: replace concatenation with string templates
Browse files Browse the repository at this point in the history
Replace string concatenation in `tools/lint-js.js` with template
literals.

PR-URL: #15858
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
Ethan-Arrowood authored and MylesBorins committed Oct 18, 2017
1 parent 2ddd9cb commit a15f33c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/jslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ if (cluster.isMaster) {
} else {
failures += results.length;
}
outFn(formatter(results) + '\r\n');
outFn(`${formatter(results)}\r\n`);
printProgress();
} else {
successes += results;
Expand Down Expand Up @@ -211,7 +211,7 @@ if (cluster.isMaster) {
return;

// Clear line
outFn('\r' + ' '.repeat(lastLineLen) + '\r');
outFn(`\r ${' '.repeat(lastLineLen)}\r`);

// Calculate and format the data for displaying
const elapsed = process.hrtime(startTime)[0];
Expand All @@ -226,7 +226,7 @@ if (cluster.isMaster) {

// Truncate line like cpplint does in case it gets too long
if (line.length > 75)
line = line.slice(0, 75) + '...';
line = `${line.slice(0, 75)}...`;

// Store the line length so we know how much to erase the next time around
lastLineLen = line.length;
Expand All @@ -235,7 +235,7 @@ if (cluster.isMaster) {
}

function padString(str, len, chr) {
str = '' + str;
str = `${str}`;
if (str.length >= len)
return str;
return chr.repeat(len - str.length) + str;
Expand Down

0 comments on commit a15f33c

Please sign in to comment.