]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/docs/rules/no-return-assign.md
upgrade to v7.0.0
[pve-eslint.git] / eslint / docs / rules / no-return-assign.md
index 781d5973a78f224a47d788906c4d3f4a89096bb4..ed40c275437d3558e7186792e67273ae771738c9 100644 (file)
@@ -40,6 +40,14 @@ function doSomething() {
 function doSomething() {
     return foo += 2;
 }
+
+const foo = (a, b) => a = b
+
+const bar = (a, b, c) => (a = b, c == b)
+
+function doSomething() {
+    return foo = bar && foo > 0;
+}
 ```
 
 Examples of **correct** code for the default `"except-parens"` option:
@@ -58,6 +66,14 @@ function doSomething() {
 function doSomething() {
     return (foo = bar + 2);
 }
+
+const foo = (a, b) => (a = b)
+
+const bar = (a, b, c) => ((a = b), c == b)
+
+function doSomething() {
+    return (foo = bar) && foo > 0;
+}
 ```
 
 ### always