tools: enable no-unused-expressions lint rule#36248
Closed
targos wants to merge 1 commit intonodejs:masterfrom
Closed
tools: enable no-unused-expressions lint rule#36248targos wants to merge 1 commit intonodejs:masterfrom
targos wants to merge 1 commit intonodejs:masterfrom
Conversation
aduh95
approved these changes
Nov 24, 2020
cjihrig
approved these changes
Nov 24, 2020
joyeecheung
approved these changes
Nov 24, 2020
lpinca
approved these changes
Nov 24, 2020
ZYSzys
approved these changes
Nov 25, 2020
kaizhu256
reviewed
Nov 25, 2020
Contributor
There was a problem hiding this comment.
can this be wrapped inside a noop or would it significantly affect the benchmark?
+function noop() {
+ return;
+}
...
- nodeTiming.idleTime; // eslint-disable-line no-unused-expressions
+ noop(nodeTiming.idleTime);
Member
Author
There was a problem hiding this comment.
I think it's better to explicitly disable a rule when necessary instead of working around it.
Contributor
There was a problem hiding this comment.
ok i agree - gives more eyeballs to scrutinize these weird pieces of code.
maybe adding a comment justifying naked-property-access could help catch more bugs in the pr (like whether they're actually needed or not)?
+ // benchmark getter() idleTime
nodeTiming.idleTime; // eslint-disable-line no-unused-expressions
Trott
approved these changes
Nov 26, 2020
jasnell
approved these changes
Nov 30, 2020
a1a77c1 to
2a0e98e
Compare
This comment has been minimized.
This comment has been minimized.
Collaborator
targos
added a commit
that referenced
this pull request
Dec 7, 2020
Fixes: #36246 PR-URL: #36248 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Member
Author
|
Landed in bf31d3c |
cjihrig
pushed a commit
to cjihrig/node
that referenced
this pull request
Dec 8, 2020
Fixes: nodejs#36246 PR-URL: nodejs#36248 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
added a commit
that referenced
this pull request
Dec 21, 2020
Fixes: #36246 PR-URL: #36248 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
whiteslack
approved these changes
Dec 26, 2020
targos
added a commit
that referenced
this pull request
May 16, 2021
Fixes: #36246 PR-URL: #36248 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
targos
added a commit
that referenced
this pull request
Jun 11, 2021
Fixes: #36246 PR-URL: #36248 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #36246
There are many places where I needed to disable the rule but I think it's still worth to have it. A few real mistakes are fixed thanks to it.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes