Skip to content

Commit 6c73628

Browse files
Ethan-ArrowoodMylesBorins
authored andcommitted
tools: replace concatenation with string templates
Replace string concatenation in `tools/lint-js.js` with template literals. PR-URL: #15858 Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 3996e8a commit 6c73628

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/jslint.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ if (cluster.isMaster) {
155155
} else {
156156
failures += results.length;
157157
}
158-
outFn(formatter(results) + '\r\n');
158+
outFn(`${formatter(results)}\r\n`);
159159
printProgress();
160160
} else {
161161
successes += results;
@@ -211,7 +211,7 @@ if (cluster.isMaster) {
211211
return;
212212

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

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

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

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

237237
function padString(str, len, chr) {
238-
str = '' + str;
238+
str = `${str}`;
239239
if (str.length >= len)
240240
return str;
241241
return chr.repeat(len - str.length) + str;

0 commit comments

Comments
 (0)