Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
czizzy opened this issue Feb 28, 2024 · 1 comment · May be fixed by #2296
Open

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

czizzy opened this issue Feb 28, 2024 · 1 comment · May be fixed by #2296

Comments

@czizzy
Copy link

czizzy commented Feb 28, 2024

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.

@fisker
Copy link
Collaborator

fisker commented Feb 28, 2024

Remove this line should fix this

PR welcome.

@czizzy czizzy linked a pull request Feb 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants