Skip to content

Commit

Permalink
Add documentation for the jsx-curly-spacing alternative option
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed Jun 5, 2016
1 parent 82b4fb7 commit 5317452
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/rules/jsx-curly-spacing.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,25 @@ The following patterns are not warnings:
<Hello name={ {firstname: 'John', lastname: 'Doe'} } />;
```

#### Alternative

When setting the `alternative` option to `true` you must collapse the curly braces:

```json
"jsx-curly-spacing": [2, "always", {"alternative": true}]
```

When `"always"` is used and `alternative` is `true`, the following pattern is not warnings:

```js
<App foo={{ bar: true, baz: true }} />;
```

When `"always"` is used and `alternative` is `true`, the following pattern is considered warnings:

```js
<App foo={ {bar: true, baz: true} } />;
```

## When Not To Use It

Expand Down

0 comments on commit 5317452

Please sign in to comment.