sindresorhus / eslint-plugin-unicorn

More than 100 powerful ESLint rules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`no-array-callback-reference` false positive

Pnlvfx opened this issue · comments

As you can see down here, I'm getting the error: Do not pass a function. However I'm not passing a function, the variable "s" is a string a not a function,
the containerElement_.find is a cheerio function that accept a string, so nothing is wrong on my code.

const sel = ["a[href^='/imgres']", 'a[jsaction]'];
const linkElementHref = sel.map((s) => containerElement_.find(s)
Do not pass function `s` directly to `.find(…)`.eslint[unicorn/no-array-callback-reference](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v51.0.1/docs/rules/no-array-callback-reference.md)

Duplicate of #1193