Skip to content

Commit

Permalink
no-array-callback-reference: Fix incorrect example
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jan 27, 2021
1 parent 11ce1bc commit 43b1e3c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions docs/rules/no-array-callback-reference.md
Expand Up @@ -30,7 +30,6 @@ const unicorn = require('unicorn');
//=> [2, 3, 5]
```


## Fail

```js
Expand Down Expand Up @@ -88,12 +87,9 @@ const fn = (a, b) => a.concat(b);
```

```js
const fn = x => x === 2;

[1, 2, 3].map(m({foo: 'bar'}));
[1, 2, 3].map(someFunction({foo: 'bar'}));
```


## Pass

```js
Expand Down Expand Up @@ -161,9 +157,7 @@ const fn = (a, b) => a.concat(b);
```

```js
const fn = x => x === 2;

[1, 2, 3].map(x => m({foo: 'bar'})(x));
[1, 2, 3].map(x => someFunction({foo: 'bar'})(x));
```

```js
Expand Down

1 comment on commit 43b1e3c

@fisker
Copy link
Collaborator

@fisker fisker commented on 43b1e3c Jan 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other incorrect examples.

Please sign in to comment.