FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

tools: enable no-unused-expressions lint rule by targos · Pull Request #36248 · nodejs/node · GitHub

/ node Public

tools: enable no-unused-expressions lint rule - #36248

Closed
targos wants to merge 1 commit into
nodejs:masterfrom
targos:no-unused-expressions
Closed

tools: enable no-unused-expressions lint rule#36248
targos wants to merge 1 commit into
nodejs:masterfrom
targos:no-unused-expressions

Conversation

targos commented Nov 24, 2020
edited
Loading

Copy link
Copy Markdown
Member

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), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

nodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Nov 24, 2020
Comment thread lib/internal/errors.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think it's better to explicitly disable a rule when necessary instead of working around it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

targos force-pushed the no-unused-expressions branch from a1a77c1 to 2a0e98e Compare December 6, 2020 15:34
targos added the request-ci Add this label to start a Jenkins CI on a PR. label Dec 6, 2020
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 6, 2020

This comment has been minimized.

Copy link
Copy Markdown
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>

targos commented Dec 7, 2020

Copy link
Copy Markdown
Member Author

Landed in bf31d3c

targos closed this Dec 7, 2020
targos deleted the no-unused-expressions branch December 7, 2020 19:37
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>
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

Labels

lib / src Issues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

There is no linter warning for an async function that is not called

Back | FazBrowse Home | New Git URL