]> git.proxmox.com Git - pve-eslint.git/blobdiff - eslint/docs/rules/curly.md
bump version to 8.4.0-3
[pve-eslint.git] / eslint / docs / rules / curly.md
index 9f4df27353cd1200f92c2c68a42e9e1073853ab7..aecbca5576ef9a3048b7bcd934a16230c0bfab50 100644 (file)
@@ -181,10 +181,6 @@ while (true) {
 for (var i = 0; foo; i++) {
     doSomething();
 }
-
-if (foo)
-    // some comment
-    bar();
 ```
 
 Examples of **correct** code for the `"multi-or-nest"` option:
@@ -214,6 +210,18 @@ while (true)
 
 for (var i = 0; foo; i++)
     doSomething();
+```
+
+For single-line statements preceded by a comment, braces are allowed but not required.
+
+Examples of additional **correct** code for the `"multi-or-nest"` option:
+
+```js
+/*eslint curly: ["error", "multi-or-nest"]*/
+
+if (foo)
+    // some comment
+    bar();
 
 if (foo) {
     // some comment