| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
In most cases, named functions match the variable or property to which they are being assigned. That also seems to be the practice in a series of PRs currently being evaluated that name currently-anonymous functions. This change applies that rule to instances in the code base that don't comply with that practice. This will be enforceable with a lint rule once we upgrade to ESLint 3.8.0.
There was a problem hiding this comment.
I don't mind the changes. +0 on activating the rule.
Sorry, something went wrong.
| res.reading = handle.reading; | ||
| Object.defineProperty(handle, 'reading', { | ||
| get: function readingGetter() { | ||
| get: function get() { |
There was a problem hiding this comment.
What about using get() { ?
Sorry, something went wrong.
There was a problem hiding this comment.
I find that confusing to read. I will probably change my opinion as it becomes more common and I get used to seeing it. If there's a strong preference for it among others, I'll use it. But if left to my own devices, I prefer the explicit key: value format instead.
Sorry, something went wrong.
| return res.reading; | ||
| }, | ||
| set: function readingSetter(value) { | ||
| set: function set(value) { |
There was a problem hiding this comment.
Ditto
Sorry, something went wrong.
| }; | ||
|
|
||
| s.destroy = s.destroySoon = function destroy() { | ||
| s.destroy = s.destroySoon = function destroySoon() { |
There was a problem hiding this comment.
This one is ambiguous. I would keep destroy if I had the choice. Did ESLint complain?
Anyway that's fine. It's just a test...
Sorry, something went wrong.
There was a problem hiding this comment.
Yeah, ESLint wanted it to be destroySoon. I agree that destroy is probably preferable, I'll switch it back.
Sorry, something went wrong.
| }, | ||
| { // Make sure this is always the last test, since we change os.homedir() | ||
| before: function mockHomedirFailure() { | ||
| before: function before() { |
There was a problem hiding this comment.
Nit: shorthand syntax
Sorry, something went wrong.
| input: putIn, | ||
| output: putIn, | ||
| completer: function completerSyncMode(line) { | ||
| completer: function completer(line) { |
There was a problem hiding this comment.
Ditto here and on line 326.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
One more CI for good measure: https://ci.nodejs.org/job/node-test-commit/5698/ Only red in that one is a build failure on a Raspberry Pi. |
Sorry, something went wrong.
In most cases, named functions match the variable or property to which they are being assigned. That also seems to be the practice in a series of PRs currently being evaluated that name currently-anonymous functions. This change applies that rule to instances in the code base that don't comply with that practice. This will be enforceable with a lint rule once we upgrade to ESLint 3.8.0. PR-URL: nodejs#9113 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
In most cases, named functions match the variable or property to which they are being assigned. That also seems to be the practice in a series of PRs currently being evaluated that name currently-anonymous functions. This change applies that rule to instances in the code base that don't comply with that practice. This will be enforceable with a lint rule once we upgrade to ESLint 3.8.0. PR-URL: #9113 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
In most cases, named functions match the variable or property to which they are being assigned. That also seems to be the practice in a series of PRs currently being evaluated that name currently-anonymous functions. This change applies that rule to instances in the code base that don't comply with that practice. This will be enforceable with a lint rule once we upgrade to ESLint 3.8.0. PR-URL: #9113 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
|
hey @Trott I've backported this to both v6 and v4 in 7b75cb9 and bd99b2d respectively. The v4 change had some conflicts, specifically in files where you changes touched stuff that didn't exist in the tree. I'm under the impression we would want this work backported, please let me know if we should revert. |
Sorry, something went wrong.
|
it seems this backport did not happen on v4.x @Trott should we backport? |
Sorry, something went wrong.
I'd prefer that we do, yes. |
Sorry, something went wrong.
|
@Trott would you be willing to backport to v4.x? |
Sorry, something went wrong.
In most cases, named functions match the variable or property to which they are being assigned. That also seems to be the practice in a series of PRs currently being evaluated that name currently-anonymous functions. This change applies that rule to instances in the code base that don't comply with that practice. This will be enforceable with a lint rule once we upgrade to ESLint 3.8.0. PR-URL: nodejs#9113 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Sorry, something went wrong.
In most cases, named functions match the variable or property to which they are being assigned. That also seems to be the practice in a series of PRs currently being evaluated that name currently-anonymous functions. This change applies that rule to instances in the code base that don't comply with that practice. This will be enforceable with a lint rule once we upgrade to ESLint 3.8.0. PR-URL: #9113 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
In most cases, named functions match the variable or property to which they are being assigned. That also seems to be the practice in a series of PRs currently being evaluated that name currently-anonymous functions. This change applies that rule to instances in the code base that don't comply with that practice. This will be enforceable with a lint rule once we upgrade to ESLint 3.8.0. PR-URL: #9113 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
In most cases, named functions match the variable or property to which they are being assigned. That also seems to be the practice in a series of PRs currently being evaluated that name currently-anonymous functions. This change applies that rule to instances in the code base that don't comply with that practice. This will be enforceable with a lint rule once we upgrade to ESLint 3.8.0. PR-URL: #9113 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
In most cases, named functions match the variable or property to which they are being assigned. That also seems to be the practice in a series of PRs currently being evaluated that name currently-anonymous functions. This change applies that rule to instances in the code base that don't comply with that practice. This will be enforceable with a lint rule once we upgrade to ESLint 3.8.0. PR-URL: #9113 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
| Back | FazBrowse Home | New Git URL |
Checklist
Affected core subsystem(s)
test lib benchmark
Description of change
In most cases, named functions match the variable or property to which
they are being assigned. That also seems to be the practice in a series
of PRs currently being evaluated that name currently-anonymous
functions.
This change applies that rule to instances in the code base that don't
comply with that practice.
This will be enforceable with a lint rule once we upgrade to ESLint
3.8.0.