From 2409db6c99f9895e6e711545c8182ecee45fd2ed Mon Sep 17 00:00:00 2001 From: Ethan Arrowood Date: Fri, 6 Oct 2017 09:59:28 -0700 Subject: [PATCH] tools: replace concatenation with string templates Replace string concatenation in `tools/lint-js.js` with template literals. PR-URL: https://github.com/nodejs/node/pull/15858 Reviewed-By: Rich Trott --- tools/jslint.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/jslint.js b/tools/jslint.js index a8f4d498ed5ab1..23ff55a67fb7a5 100644 --- a/tools/jslint.js +++ b/tools/jslint.js @@ -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; @@ -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]; @@ -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; @@ -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;