Skip to content

Commit aa7e11c

Browse files
committed
docs: update rule examples
1 parent e734aa6 commit aa7e11c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ This rule is auto fixable.
204204
#### Examples
205205
Code that triggers this rule:
206206
```js
207-
const flattenedAndMapped = array.flat().map((p) => p);
207+
const flattenedAndMapped = array.map((p) => p).flat();
208208
```
209209

210210
Code that doesn't trigger this rule:
@@ -215,9 +215,9 @@ const flattened = array.flat();
215215

216216
const mapped = array.map((r) => r + 1);
217217

218-
const mappedThenFlattened = array.map((r) => r + 1).flat();
218+
const mappedThenFlattened = array.flat().map((r) => r + 1);
219219

220-
const flatMappedWithExtra = array.flat().reverse().map((r) => r + 1);
220+
const flatMappedWithExtra = array.map((r) => r + 1).reverse().flat();
221221
```
222222

223223
### `prefer-flat`

0 commit comments

Comments
 (0)