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 a679e06

Browse filesBrowse files
vsemozhetbytMylesBorins
authored andcommitted
tools: use no-useless-concat ESLint rule
* Add `no-useless-concat: error` to .eslintrc.yaml. * Apply no-useless-concat rule to tests. PR-URL: #12613 Backport-PR-URL: #13056 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net>
1 parent a0f9d59 commit a679e06
Copy full SHA for a679e06
Expand file treeCollapse file tree

8 files changed

+20
-23
lines changed
Open diff view settings
Collapse file

‎.eslintrc.yaml‎

Copy file name to clipboardExpand all lines: .eslintrc.yaml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ rules:
4444
no-self-assign: 2
4545
no-unused-labels: 2
4646
no-useless-call: 2
47+
no-useless-concat: 2
4748
no-useless-escape: 2
4849
no-useless-return: 2
4950
no-void: 2
Collapse file

‎test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-domain-throw-error-then-throw-from-uncaught-exception-handler.js
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,10 @@ function createTestCmdLine(options) {
9393
testCmd += process.argv[0];
9494

9595
if (options && options.withAbortOnUncaughtException) {
96-
testCmd += ' ' + '--abort-on-uncaught-exception';
96+
testCmd += ' --abort-on-uncaught-exception';
9797
}
9898

99-
testCmd += ' ' + process.argv[1];
100-
testCmd += ' ' + 'child';
99+
testCmd += ` ${process.argv[1]} child`;
101100

102101
return testCmd;
103102
}
Collapse file

‎test/parallel/test-http-server-unconsume-consume.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-server-unconsume-consume.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const http = require('http');
44

55
const testServer = http.createServer(common.mustNotCall());
66
testServer.on('connect', common.mustCall((req, socket, head) => {
7-
socket.write('HTTP/1.1 200 Connection Established' + '\r\n' +
8-
'Proxy-agent: Node-Proxy' + '\r\n' +
7+
socket.write('HTTP/1.1 200 Connection Established\r\n' +
8+
'Proxy-agent: Node-Proxy\r\n' +
99
'\r\n');
1010
// This shouldn't raise an assertion in StreamBase::Consume.
1111
testServer.emit('connection', socket);
Collapse file

‎test/parallel/test-http-set-trailers.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-set-trailers.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ let outstanding_reqs = 0;
99
const server = http.createServer(function(req, res) {
1010
res.writeHead(200, [['content-type', 'text/plain']]);
1111
res.addTrailers({'x-foo': 'bar'});
12-
res.end('stuff' + '\n');
12+
res.end('stuff\n');
1313
});
1414
server.listen(0);
1515

Collapse file

‎test/parallel/test-net-write-connect-write.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-net-write-connect-write.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ const server = net.createServer(function(socket) {
1212
conn.setEncoding('utf8');
1313
conn.write('before');
1414
conn.on('connect', function() {
15-
conn.write('after');
15+
conn.write(' after');
1616
});
1717
conn.on('data', function(buf) {
1818
received += buf;
1919
conn.end();
2020
});
2121
conn.on('end', common.mustCall(function() {
2222
server.close();
23-
assert.strictEqual(received, 'before' + 'after');
23+
assert.strictEqual(received, 'before after');
2424
}));
2525
}));
Collapse file

‎test/parallel/test-preload.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-preload.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ interactive.stdin.write('a\n');
128128
interactive.stdin.write('process.exit()\n');
129129

130130
childProcess.exec(
131-
nodeBinary + ' ' + '--require ' + fixture('cluster-preload.js') + ' ' +
131+
`${nodeBinary} --require ${fixture('cluster-preload.js')} ` +
132132
fixture('cluster-preload-test.js'),
133133
function(err, stdout, stderr) {
134134
if (err) throw err;
@@ -139,8 +139,8 @@ childProcess.exec(
139139
// https://github.com/nodejs/node/issues/1691
140140
process.chdir(common.fixturesDir);
141141
childProcess.exec(
142-
nodeBinary + ' ' + '--expose_natives_as=v8natives ' + '--require ' +
143-
fixture('cluster-preload.js') + ' ' + 'cluster-preload-test.js',
142+
`${nodeBinary} --expose_natives_as=v8natives --require ` +
143+
`${fixture('cluster-preload.js')} cluster-preload-test.js`,
144144
function(err, stdout, stderr) {
145145
if (err) throw err;
146146
assert.ok(/worker terminated with code 43/.test(stdout));
Collapse file

‎test/parallel/test-repl.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-repl.js
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,12 @@ function tcp_test() {
414414
{ client: client_tcp, send: '',
415415
expect: prompt_tcp },
416416
{ client: client_tcp, send: 'invoke_me(333)',
417-
expect: ('\'' + 'invoked 333' + '\'\n' + prompt_tcp) },
417+
expect: (`'invoked 333'\n${prompt_tcp}`) },
418418
{ client: client_tcp, send: 'a += 1',
419-
expect: ('12346' + '\n' + prompt_tcp) },
419+
expect: (`12346\n${prompt_tcp}`) },
420420
{ client: client_tcp,
421421
send: 'require(' + JSON.stringify(moduleFilename) + ').number',
422-
expect: ('42' + '\n' + prompt_tcp) }
422+
expect: (`42\n${prompt_tcp}`) }
423423
]);
424424
});
425425

@@ -483,13 +483,13 @@ function unix_test() {
483483
{ client: client_unix, send: '',
484484
expect: prompt_unix },
485485
{ client: client_unix, send: 'message',
486-
expect: ('\'' + message + '\'\n' + prompt_unix) },
486+
expect: (`'${message}'\n${prompt_unix}`) },
487487
{ client: client_unix, send: 'invoke_me(987)',
488-
expect: ('\'' + 'invoked 987' + '\'\n' + prompt_unix) },
488+
expect: (`'invoked 987'\n${prompt_unix}`) },
489489
{ client: client_unix, send: 'a = 12345',
490-
expect: ('12345' + '\n' + prompt_unix) },
490+
expect: (`12345\n${prompt_unix}`) },
491491
{ client: client_unix, send: '{a:1}',
492-
expect: ('{ a: 1 }' + '\n' + prompt_unix) }
492+
expect: (`{ a: 1 }\n${prompt_unix}`) }
493493
]);
494494
});
495495

Collapse file

‎test/sequential/test-domain-abort-on-uncaught.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-domain-abort-on-uncaught.js
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,8 @@ if (process.argv[2] === 'child') {
239239
testCmd += 'ulimit -c 0 && ';
240240
}
241241

242-
testCmd += process.argv[0];
243-
testCmd += ' ' + '--abort-on-uncaught-exception';
244-
testCmd += ' ' + process.argv[1];
245-
testCmd += ' ' + 'child';
246-
testCmd += ' ' + testIndex;
242+
testCmd += `${process.argv[0]} --abort-on-uncaught-exception ` +
243+
`${process.argv[1]} child ${testIndex}`;
247244

248245
const child = child_process.exec(testCmd);
249246

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.