Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2409db6

Browse filesBrowse 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 3ad6a9d commit 2409db6
Copy full SHA for 2409db6

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Open diff view settings
Collapse file

‎tools/jslint.js‎

Copy file name to clipboardExpand all lines: tools/jslint.js
+4-4Lines changed: 4 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.