sindresorhus / eslint-plugin-unicorn

More than 100 powerful ESLint rules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`unicorn/no-array-callback-reference` does not report when optional chaining

czizzy opened this issue · comments

this rule is not reported when optional chaining

unicorn/no-array-callback-reference

function isString(arg) {
  return typeof arg === 'string';
}

const obj = { a: [], b: [] };

obj.a.filter(isString);
obj.b?.filter(isString);

only the first filter report an error.

Remove this line should fix this

PR welcome.