Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Docs: fix curly multi-or-nest examples with comments (refs #12972) (#…
  • Loading branch information
mdjermanovic committed Apr 7, 2020
1 parent 57221d5 commit c41de38
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions docs/rules/curly.md
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c41de38

Please sign in to comment.