Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced string concats with template literals #15858

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tools/lint-js.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