dns: use template literals#5809
Conversation
|
This is not my interpretation of moving incrementally, but hey. |
|
I'm +0 but LGTM |
|
@Fishrock123 elaborate please? I'm not tied to any of the DNS PRs and would like to understand better what would make better contributions. |
There was a problem hiding this comment.
FYI, this will still trigger a "unexpected string concatenation" in ESLint because of the ' ' + hostname part.
Yes, that's basically what I had in mind, although I left a comment on one of them. (Feel free to come up with your own solution there, or no solution at all, but probably, the ternary should be moved to its own line and set to variable which can be included in the template literal. That will improve readability, which is basically what the whole change-to-template-literal thing is about.) Again, not sure if this is something that will gain consensus or not, but I certainly like it and I'm optimistic. Some parts of the code are easier to convert to template literals than others, though. If you're brave, take a crack at |
Prefer the use of template string literals over string concatenation in the dns module, makes dns consistent with other modules basically doing nodejs#5778 for it. PR-URL: nodejs#5809 Reviewed-By: James M Snell <jasnell@gmail.com>
8a70021 to
74174d6
Compare

Affected core subsystem(s)
dns
Description of change
Prefer the use of template string literals over string concatenation in the dns module, makes dns consistent with other modules basically doing #5778 for it.
(ci https://ci.nodejs.org/job/node-test-pull-request/1976/ )