From 3c0ebf5aca935ebacf4f5b862c2ad4fb67614bcb Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Mon, 16 Oct 2017 18:37:14 -0400 Subject: tools: enable additional eslint rules Enable additional rules that node either already adheres to or it makes sense to do so going forward: for-direction, accessor-pairs, no-lonely-if and symbol-description. Fix all instances of no-lonely-if in lib & test and disable accessor-pairs in test-util-inspect. PR-URL: https://github.com/nodejs/node/pull/16243 Refs: https://eslint.org/docs/rules/for-direction Refs: https://eslint.org/docs/rules/accessor-pairs Refs: https://eslint.org/docs/rules/no-lonely-if Refs: https://eslint.org/docs/rules/symbol-description Reviewed-By: Ruben Bridgewater Reviewed-By: Vse Mozhet Byt Reviewed-By: Refael Ackermann Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig --- lib/url.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'lib/url.js') diff --git a/lib/url.js b/lib/url.js index b1e0ff8da5..72e03e0f9c 100644 --- a/lib/url.js +++ b/lib/url.js @@ -128,16 +128,14 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { if (isWs) continue; lastPos = start = i; - } else { - if (inWs) { - if (!isWs) { - end = -1; - inWs = false; - } - } else if (isWs) { - end = i; - inWs = true; + } else if (inWs) { + if (!isWs) { + end = -1; + inWs = false; } + } else if (isWs) { + end = i; + inWs = true; } // Only convert backslashes while we haven't seen a split character -- cgit v1.2.3