Repository: eslint/eslint (js)

Issue:
npm install not working.
**Tell us about your environment**

* **ESLint Version:** master
* **Node Version:** 7.6.0
* **npm Version:** 4.2.0

**What parser (default, Babel-ESLint, etc.) are you using?**

- default

**Please show your full configuration:**

- nothing

**What did you do? Please include the actual source code causing the issue.**

`npm install` in ESLint repo.

**What did you expect to happen?**

`npm install` completes normally.

**What actually happened? Please include the actual, raw output from ESLint.**

`npm install` failed.


```
~\Documents\GitHub\eslint [no-extra-parens/spread-operators]> npm install
npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:192:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:890:16)
npm WARN addRemoteGit     at Socket.<anonymous> (internal/child_process.js:334:11)
npm WARN addRemoteGit     at emitOne (events.js:96:13)
npm WARN addRemoteGit     at Socket.emit (events.js:189:7)
npm WARN addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:501:12)
npm WARN addRemoteGit  git://github.com/not-an-aardvark/mock-fs/#06868bbd7724707f9324b237bdde28f05f7a01d5 resetting remote C:\Users\t-nagashima.AD\AppData\Roami
ng\npm-cache\_git-remotes\git-github-com-not-an-aardvark-mock-fs-06868bbd7724707f9324b237bdde28f05f7a01d5-cdc216ca because of error: { Error: Command failed: gi
t -c core.longpaths=true config --get remote.origin.url
npm WARN addRemoteGit
npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:211:12)
npm WARN addRemoteGit     at emitTwo (events.js:106:13)
npm WARN addRemoteGit     at ChildProcess.emit (events.js:192:7)
npm WARN addRemoteGit     at maybeClose (internal/child_process.js:890:16)
npm WARN addRemoteGit     at Socket.<anonymous> (internal/child_process.js:334:11)
npm WARN addRemoteGit     at emitOne (events.js:96:13)
npm WARN addRemoteGit     at Socket.emit (events.js:189:7)
npm WARN addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:501:12)
npm WARN addRemoteGit   killed: false,
npm WARN addRemoteGit   code: 1,
npm WARN addRemoteGit   signal: null,
npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
npm ERR! git clone --template=C:\Users\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/not-an-aardvark/mock-fs/ C:\Us
ers\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\git-github-com-not-an-aardvark-mock-fs-06868bbd7724707f9324b237bdde28f05f7a01d5-cdc216ca: Cloning into
 bare repository 'C:\Users\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\git-github-com-not-an-aardvark-mock-fs-06868bbd7724707f9324b237bdde28f05f7a01d5
-cdc216ca'...
npm ERR! git clone --template=C:\Users\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/not-an-aardvark/mock-fs/ C:\Us
ers\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\git-github-com-not-an-aardvark-mock-fs-06868bbd7724707f9324b237bdde28f05f7a01d5-cdc216ca: fatal: unabl
e to connect to github.com:
npm ERR! git clone --template=C:\Users\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/not-an-aardvark/mock-fs/ C:\Us
ers\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\git-github-com-not-an-aardvark-mock-fs-06868bbd7724707f9324b237bdde28f05f7a01d5-cdc216ca: github.com[0
: 192.30.253.113]: errno=No error
npm ERR! git clone --template=C:\Users\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://github.com/not-an-aardvark/mock-fs/ C:\Us
ers\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\git-github-com-not-an-aardvark-mock-fs-06868bbd7724707f9324b237bdde28f05f7a01d5-cdc216ca: github.com[1
: 192.30.253.112]: errno=No error
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Users\\t-nagashima.AD\\nodist\\v-x64\\nodev7.6.0\\node.exe" "C:\\Users\\t-nagashima.AD\\nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js" "ins
tall"
npm ERR! node v7.6.0
npm ERR! npm  v4.2.0
npm ERR! code 128

npm ERR! Command failed: git -c core.longpaths=true clone --template=C:\Users\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror git://gi
thub.com/not-an-aardvark/mock-fs/ C:\Users\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\git-github-com-not-an-aardvark-mock-fs-06868bbd7724707f9324b237
bdde28f05f7a01d5-cdc216ca
npm ERR! Cloning into bare repository 'C:\Users\t-nagashima.AD\AppData\Roaming\npm-cache\_git-remotes\git-github-com-not-an-aardvark-mock-fs-06868bbd7724707f932
4b237bdde28f05f7a01d5-cdc216ca'...
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.253.113]: errno=No error
npm ERR! github.com[1: 192.30.253.112]: errno=No error
npm ERR!
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\t-nagashima.AD\AppData\Roaming\npm-cache\_logs\2017-03-06T22_06_08_590Z-debug.log
```


Pull request description:
Build: change mock-fs path without SSH (fixes #8207)
**What is the purpose of this pull request? (put an "X" next to item)**

[X] Other, please explain: fixes #8207

**What changes did you make? (Give an overview)**

This PR changes the notation which requires SSH to using HTTPS.
There are environments which can not use SSH for WAN.

**Is there anything you'd like reviewers to focus on?**

Nothing in particular.


Patch:
diff --git a/lib/rules/nonblock-statement-body-position.js b/lib/rules/nonblock-statement-body-position.js
index d6ee126da..212e36a57 100644
--- a/lib/rules/nonblock-statement-body-position.js
+++ b/lib/rules/nonblock-statement-body-position.js
@@ -77,7 +77,7 @@ module.exports = {
                     message: "Expected a linebreak before this statement.",
                     fix: fixer => fixer.insertTextBefore(node, "\n")
                 });
-            } else if (tokenBefore.loc.end.line !== node.loc.end.line && option === "beside") {
+            } else if (tokenBefore.loc.end.line !== node.loc.start.line && option === "beside") {
                 context.report({
                     node,
                     message: "Expected no linebreak before this statement.",
diff --git a/lib/rules/operator-assignment.js b/lib/rules/operator-assignment.js
index a6bbb177a..43f21abc8 100644
--- a/lib/rules/operator-assignment.js
+++ b/lib/rules/operator-assignment.js
@@ -135,7 +135,7 @@ module.exports = {
                                 const equalsToken = getOperatorToken(node);
                                 const operatorToken = getOperatorToken(expr);
                                 const leftText = sourceCode.getText().slice(node.range[0], equalsToken.range[0]);
-                                const rightText = sourceCode.getText().slice(operatorToken.range[1], node.range[1]);
+                                const rightText = sourceCode.getText().slice(operatorToken.range[1], expr.right.range[1]);
 
                                 return fixer.replaceText(node, `${leftText}${expr.operator}=${rightText}`);
                             }
diff --git a/package.json b/package.json
index cdd8cc0dc..6b804e396 100644
--- a/package.json
+++ b/package.json
@@ -97,7 +97,7 @@
     "load-perf": "^0.2.0",
     "markdownlint": "^0.3.1",
     "mocha": "^2.4.5",
-    "mock-fs": "git://github.com/not-an-aardvark/mock-fs/#06868bbd7724707f9324b237bdde28f05f7a01d5",
+    "mock-fs": "not-an-aardvark/mock-fs#06868bbd7724707f9324b237bdde28f05f7a01d5",
     "npm-license": "^0.3.2",
     "phantomjs-prebuilt": "^2.1.7",
     "proxyquire": "^1.7.10",


Test patch:
diff --git a/tests/lib/rules/nonblock-statement-body-position.js b/tests/lib/rules/nonblock-statement-body-position.js
index 37a3b2756..37dffb20f 100644
--- a/tests/lib/rules/nonblock-statement-body-position.js
+++ b/tests/lib/rules/nonblock-statement-body-position.js
@@ -32,6 +32,11 @@ ruleTester.run("nonblock-statement-body-position", rule, {
         "for (foo in bar) baz;",
         "for (foo of bar) baz;",
         "if (foo) bar; else baz;",
+        `
+            if (foo) bar(
+                baz
+            );
+        `,
         {
             code: "if (foo) bar();",
             options: ["beside"]
diff --git a/tests/lib/rules/operator-assignment.js b/tests/lib/rules/operator-assignment.js
index d586878d7..e0f3e4e13 100644
--- a/tests/lib/rules/operator-assignment.js
+++ b/tests/lib/rules/operator-assignment.js
@@ -149,6 +149,11 @@ ruleTester.run("operator-assignment", rule, {
         output: "x += y",
         options: ["always"],
         errors: EXPECTED_OPERATOR_ASSIGNMENT
+    }, {
+        code: "x = (x + y)",
+        output: "x += y",
+        options: ["always"],
+        errors: EXPECTED_OPERATOR_ASSIGNMENT
     }, {
         code: "x += y",
         output: "x = x + y",