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 3 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
11 changes: 5 additions & 6 deletions tools/lint-js.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ if (cluster.isMaster) {
printProgress();
outFn('\r\n');
}
if (code === 0)
process.exit(failures ? 1 : 0);
if (code === 0) process.exit(failures ? 1 : 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One here yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About to board my plane so other edits will have to wait until I get home (unless my plane has internet).

});

for (i = 0; i < numCPUs; ++i)
Expand All @@ -155,7 +154,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 +210,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 +225,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 +234,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