-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
tools: add 'spaced-comment' into eslint rules #19596
Conversation
@@ -260,7 +260,7 @@ assert.throws(function() { | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line correct now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's correct: https://eslint.org/docs/rules/spaced-comment#always
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this some built-in exception for jsdoc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. '*'
is the default marker (see here), so /**
can pass the check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this. Just a couple suggestions to remove things that seem to be obsolete. When being on it: it would also be very nice if you would use a capital letter for the first character of a comment :-) that way these changes have to be done only once instead of twice.
@@ -227,10 +227,10 @@ function runClient(prefix, port, options, cb) { | |||
} | |||
}); | |||
|
|||
//client.stdout.pipe(process.stdout); | |||
// client.stdout.pipe(process.stdout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: remove this. There is no comment about why this is kept in here.
|
||
client.on('exit', function(code) { | ||
//assert.strictEqual( | ||
// assert.strictEqual( | ||
// 0, code, | ||
// `${prefix}${options.name}: s_client exited with error code ${code}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: remove this. There is no comment about why this is kept in here.
//child.stdout.pipe(process.stdout); | ||
//child.stderr.pipe(process.stderr); | ||
// child.stdout.pipe(process.stdout); | ||
// child.stderr.pipe(process.stderr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: remove this. There is no comment why this is kept in here.
test/pummel/test-regress-GH-814.js
Outdated
@@ -32,7 +32,7 @@ function newBuffer(size, value) { | |||
while (size--) { | |||
buffer[size] = value; | |||
} | |||
//buffer[buffer.length-2]= 0x0d; | |||
// buffer[buffer.length-2]= 0x0d; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: remove this. There is no comment why this is kept in here.
test/pummel/test-regress-GH-814_2.js
Outdated
@@ -39,7 +39,7 @@ function tailCB(data) { | |||
PASS = !data.toString().includes('.'); | |||
|
|||
if (PASS) { | |||
//console.error('i'); | |||
// console.error('i'); | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: rewrite this to if (!PASS) { ...
@@ -55,7 +55,7 @@ function testHttps() { | |||
method: 'GET', | |||
path: `/${counter++}`, | |||
host: 'localhost', | |||
//agent: false, | |||
// agent: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: remove this and the other cases as well. There is no comment why this is kept in here.
@@ -78,7 +78,7 @@ server.on('listening', function() { | |||
}); | |||
|
|||
c.on('data', function(chunk) { | |||
//console.log(chunk); | |||
// console.log(chunk); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: remove this. If the test fails, this has to be debugged properly anyway and maybe needs a code change but the comment does not help in this case.
@@ -103,7 +103,7 @@ server.on('listening', function() { | |||
headers: {} | |||
}, function(res) { | |||
res.on('end', function() { | |||
//console.log(res.trailers); | |||
// console.log(res.trailers); | |||
assert.ok('x-foo' in res.trailers, 'Client doesn\'t see trailers.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: remove the comment and change the error message to include res.trailers
.
@@ -32,7 +32,7 @@ const options = { | |||
host: '127.0.0.1', | |||
}; | |||
|
|||
//http.globalAgent.maxSockets = 15; | |||
// http.globalAgent.maxSockets = 15; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: remove this. There is no comment why this is kept in here.
@@ -49,7 +49,7 @@ function nextRequest() { | |||
// throws error: | |||
nextRequest(); | |||
// works just fine: | |||
//process.nextTick(nextRequest); | |||
// process.nextTick(nextRequest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add TODO: investigate why this does not work fine even though it should.
.
f5d2b2a
to
426ff47
Compare
//console.log(res.trailers); | ||
assert.ok('x-foo' in res.trailers, 'Client doesn\'t see trailers.'); | ||
assert.ok('x-foo' in res.trailers, | ||
'Client doesn\'t see trailers in res.trailers'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
res.trailers
is an Object. Should we use the Object.keys
to show all the keys? @BridgeAR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just use util.inspect
? Object.keys
works just as fine as well though, as it is only about the keys in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer landing the commented code removal as a separate commit.
I suspect some on @nodejs/release might greatly prefer that the backports for this be in place when this lands so they can land immediately too? On the other hand, maybe not since it's only affecting comments? I'll add backport-requested labels but feel free to remove them if that's not the right thing to do. |
(Left out a backport request for 4.x since it's EOL in about a month.) |
b2e2078
to
2d57d02
Compare
2d57d02
to
e06a3ec
Compare
CI before land: https://ci.nodejs.org/job/node-test-pull-request/13973/ |
Landed in 2540581 |
PR-URL: #19596 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
PR-URL: nodejs#19596 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
This rule is not very important but still makes sense to some first-time PRs.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes