Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pawelnvk committed Oct 8, 2019
1 parent 663ca23 commit 6eeb7c0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions docs/rules/jsx-props-no-spreading.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const {one_prop, two_prop} = otherProps;
```js
...
"react/jsx-props-no-spreading": [{
"html": "ignore"|"enforce",
"custom": "ignore"|"enforce",
"explicitSpread": "ignore"|"enforce",
"html": "ignore" | "enforce",
"custom": "ignore" | "enforce",
"explicitSpread": "ignore" | "enforce",
"exceptions": [<string>]
}]
...
Expand Down Expand Up @@ -66,6 +66,16 @@ The following patterns are still considered warnings:
<img {...props} />
```

### explicitSpread

`explicitSpread` set to `ignore` will ignore spread operators that are explicilty listing all object properties within that spread. Default is set to `enforce`.

The following pattern is **not** considered warning when `explicitSpread` is set to `ignore`:

```jsx
<img {...{ prop1, prop2, prop3 }} />
```

### exceptions

An "exception" will always flip the resulting html or custom setting for that component - ie, html set to `ignore`, with an exception of `div` will enforce on an `div`; custom set to `enforce` with an exception of `Foo` will ignore `Foo`.
Expand Down

0 comments on commit 6eeb7c0

Please sign in to comment.