GeezerVison is showing github.com — tools: use no-useless-concat ESLint rule · nodejs/node@a679e06
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .eslintrc.yaml +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 44 | 44 | no-self-assign: 2 | 45 | 45 | no-unused-labels: 2 | 46 | 46 | no-useless-call: 2 | | 47 | + no-useless-concat: 2 | 47 | 48 | no-useless-escape: 2 | 48 | 49 | no-useless-return: 2 | 49 | 50 | no-void: 2 | |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -93,11 +93,10 @@ function createTestCmdLine(options) { | 93 | 93 | testCmd += process.argv[0]; | 94 | 94 |
| 95 | 95 | if (options && options.withAbortOnUncaughtException) { | 96 | | - testCmd += ' ' + '--abort-on-uncaught-exception'; | | 96 | + testCmd += ' --abort-on-uncaught-exception'; | 97 | 97 | } | 98 | 98 |
| 99 | | - testCmd += ' ' + process.argv[1]; | 100 | | - testCmd += ' ' + 'child'; | | 99 | + testCmd += ` ${process.argv[1]} child`; | 101 | 100 |
| 102 | 101 | return testCmd; | 103 | 102 | } |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -4,8 +4,8 @@ const http = require('http'); | 4 | 4 |
| 5 | 5 | const testServer = http.createServer(common.mustNotCall()); | 6 | 6 | 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' + | 9 | 9 | '\r\n'); | 10 | 10 | // This shouldn't raise an assertion in StreamBase::Consume. | 11 | 11 | testServer.emit('connection', socket); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-http-set-trailers.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,7 +9,7 @@ let outstanding_reqs = 0; | 9 | 9 | const server = http.createServer(function(req, res) { | 10 | 10 | res.writeHead(200, [['content-type', 'text/plain']]); | 11 | 11 | res.addTrailers({'x-foo': 'bar'}); | 12 | | - res.end('stuff' + '\n'); | | 12 | + res.end('stuff\n'); | 13 | 13 | }); | 14 | 14 | server.listen(0); | 15 | 15 |
| |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -12,14 +12,14 @@ const server = net.createServer(function(socket) { | 12 | 12 | conn.setEncoding('utf8'); | 13 | 13 | conn.write('before'); | 14 | 14 | conn.on('connect', function() { | 15 | | - conn.write('after'); | | 15 | + conn.write(' after'); | 16 | 16 | }); | 17 | 17 | conn.on('data', function(buf) { | 18 | 18 | received += buf; | 19 | 19 | conn.end(); | 20 | 20 | }); | 21 | 21 | conn.on('end', common.mustCall(function() { | 22 | 22 | server.close(); | 23 | | - assert.strictEqual(received, 'before' + 'after'); | | 23 | + assert.strictEqual(received, 'before after'); | 24 | 24 | })); | 25 | 25 | })); |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-preload.js +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -128,7 +128,7 @@ interactive.stdin.write('a\n'); | 128 | 128 | interactive.stdin.write('process.exit()\n'); | 129 | 129 |
| 130 | 130 | childProcess.exec( | 131 | | - nodeBinary + ' ' + '--require ' + fixture('cluster-preload.js') + ' ' + | | 131 | + `${nodeBinary} --require ${fixture('cluster-preload.js')} ` + | 132 | 132 | fixture('cluster-preload-test.js'), | 133 | 133 | function(err, stdout, stderr) { | 134 | 134 | if (err) throw err; | @@ -139,8 +139,8 @@ childProcess.exec( | 139 | 139 | // https://github.com/nodejs/node/issues/1691 | 140 | 140 | process.chdir(common.fixturesDir); | 141 | 141 | 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`, | 144 | 144 | function(err, stdout, stderr) { | 145 | 145 | if (err) throw err; | 146 | 146 | assert.ok(/worker terminated with code 43/.test(stdout)); | |
Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-repl.js +7-7Lines changed: 7 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -414,12 +414,12 @@ function tcp_test() { | 414 | 414 | { client: client_tcp, send: '', | 415 | 415 | expect: prompt_tcp }, | 416 | 416 | { client: client_tcp, send: 'invoke_me(333)', | 417 | | - expect: ('\'' + 'invoked 333' + '\'\n' + prompt_tcp) }, | | 417 | + expect: (`'invoked 333'\n${prompt_tcp}`) }, | 418 | 418 | { client: client_tcp, send: 'a += 1', | 419 | | - expect: ('12346' + '\n' + prompt_tcp) }, | | 419 | + expect: (`12346\n${prompt_tcp}`) }, | 420 | 420 | { client: client_tcp, | 421 | 421 | send: 'require(' + JSON.stringify(moduleFilename) + ').number', | 422 | | - expect: ('42' + '\n' + prompt_tcp) } | | 422 | + expect: (`42\n${prompt_tcp}`) } | 423 | 423 | ]); | 424 | 424 | }); | 425 | 425 |
| @@ -483,13 +483,13 @@ function unix_test() { | 483 | 483 | { client: client_unix, send: '', | 484 | 484 | expect: prompt_unix }, | 485 | 485 | { client: client_unix, send: 'message', | 486 | | - expect: ('\'' + message + '\'\n' + prompt_unix) }, | | 486 | + expect: (`'${message}'\n${prompt_unix}`) }, | 487 | 487 | { client: client_unix, send: 'invoke_me(987)', | 488 | | - expect: ('\'' + 'invoked 987' + '\'\n' + prompt_unix) }, | | 488 | + expect: (`'invoked 987'\n${prompt_unix}`) }, | 489 | 489 | { client: client_unix, send: 'a = 12345', | 490 | | - expect: ('12345' + '\n' + prompt_unix) }, | | 490 | + expect: (`12345\n${prompt_unix}`) }, | 491 | 491 | { client: client_unix, send: '{a:1}', | 492 | | - expect: ('{ a: 1 }' + '\n' + prompt_unix) } | | 492 | + expect: (`{ a: 1 }\n${prompt_unix}`) } | 493 | 493 | ]); | 494 | 494 | }); | 495 | 495 |
| |
Collapse file 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 number | Diff line number | Diff line change |
|---|
@@ -239,11 +239,8 @@ if (process.argv[2] === 'child') { | 239 | 239 | testCmd += 'ulimit -c 0 && '; | 240 | 240 | } | 241 | 241 |
| 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}`; | 247 | 244 |
| 248 | 245 | const child = child_process.exec(testCmd); | 249 | 246 |
| |
|