Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEthan Arrowood <ethan.arrowood@gmail.com>2017-10-06 19:59:28 +0300
committerMyles Borins <mylesborins@google.com>2017-10-11 09:06:15 +0300
commitab7448e0d52595d1f0acc4d3d71091d1af827c7c (patch)
tree5241ad7a1ca7fcbd7fc1fee195d17bc7ad852289 /tools
parentb1e6373dccdc03d518a7b098e70ee7875c902360 (diff)
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 <rtrott@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/lint-js.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/lint-js.js b/tools/lint-js.js
index bf4337792a3..5143aea0369 100644
--- a/tools/lint-js.js
+++ b/tools/lint-js.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;