| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
This one is a bit cosmetic, so I should explain my eventual goal: I'd like to be able to enable ESLint's recommended rule set (disabling a few rules as necessary) and this file is flagged for the conditional assignment. I don't feel strongly that this version is a big improvement so if others don't see it that way, oh well, we can close it. But I don't think it makes the code worse either. |
Sorry, something went wrong.
|
@nodejs/linting |
Sorry, something went wrong.
|
I think it's possible to silence the eslint error by wrapping the assignment in parentheses |
Sorry, something went wrong.
Yes, that is correct. I considered that, but while ((node = node.parent)) is harder for me to understand/read. It raises the questions when I read the code: "Why is there an extra set of parentheses?" It's not immediately obvious, at least to me. But while ((node = node.parent) === undefined)) is perhaps a bit better. |
Sorry, something went wrong.
@targos Do you have opinions as to which options are preferable and which should be avoided?
|
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Commit Queue failed- Loading data for nodejs/node/pull/41325 ✔ Done loading data for nodejs/node/pull/41325 ----------------------------------- PR info ------------------------------------ Title tools: remove conditional assignment in custom ESLint rule (#41325) Author Rich Trott (@Trott) Branch Trott:no-cond-assign -> nodejs:master Labels tools, author ready Commits 1 - tools: remove conditional assignment in custom ESLint rule Committers 1 - Rich Trott PR-URL: https://github.com/nodejs/node/pull/41325 Reviewed-By: Michaël Zasso ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/41325 Reviewed-By: Michaël Zasso -------------------------------------------------------------------------------- ℹ This PR was created on Sun, 26 Dec 2021 03:55:17 GMT ✔ Approvals: 1 ✔ - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/41325#pullrequestreview-842514715 ✖ GitHub CI is still running ℹ Green GitHub CI is sufficient -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/1657795258 |
Sorry, something went wrong.
Commit Queue failed- Loading data for nodejs/node/pull/41325 ✔ Done loading data for nodejs/node/pull/41325 ----------------------------------- PR info ------------------------------------ Title tools: remove conditional assignment in custom ESLint rule (#41325) Author Rich Trott (@Trott) Branch Trott:no-cond-assign -> nodejs:master Labels tools, author ready Commits 1 - tools: remove conditional assignment in custom ESLint rule Committers 1 - Rich Trott PR-URL: https://github.com/nodejs/node/pull/41325 Reviewed-By: Michaël Zasso ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/41325 Reviewed-By: Michaël Zasso -------------------------------------------------------------------------------- ℹ This PR was created on Sun, 26 Dec 2021 03:55:17 GMT ✔ Approvals: 1 ✔ - Michaël Zasso (@targos) (TSC): https://github.com/nodejs/node/pull/41325#pullrequestreview-842514715 ✖ GitHub CI is still running ℹ Green GitHub CI is sufficient -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/1658007831 |
Sorry, something went wrong.
These changes no-duplicate-require.js so that it doesn't use an assignment in a conditional, which can be easy to misread as a comparison rather than an assignment. It also means we change a do/while (which we don't use much in our code) to the much more common while construct. PR-URL: nodejs#41325 Reviewed-By: Michaël Zasso <targos@protonmail.com>
These changes no-duplicate-require.js so that it doesn't use an assignment in a conditional, which can be easy to misread as a comparison rather than an assignment. It also means we change a do/while (which we don't use much in our code) to the much more common while construct. PR-URL: #41325 Reviewed-By: Michaël Zasso <targos@protonmail.com>
These changes no-duplicate-require.js so that it doesn't use an assignment in a conditional, which can be easy to misread as a comparison rather than an assignment. It also means we change a do/while (which we don't use much in our code) to the much more common while construct. PR-URL: #41325 Reviewed-By: Michaël Zasso <targos@protonmail.com>
These changes no-duplicate-require.js so that it doesn't use an assignment in a conditional, which can be easy to misread as a comparison rather than an assignment. It also means we change a do/while (which we don't use much in our code) to the much more common while construct. PR-URL: #41325 Reviewed-By: Michaël Zasso <targos@protonmail.com>
| Back | FazBrowse Home | New Git URL |
These changes no-duplicate-require.js so that it doesn't use an
assignment in a conditional, which can be easy to misread as a
comparison rather than an assignment. It also means we change a do/while
(which we don't use much in our code) to the much more common while
construct.