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-invalid-remove-event-listener does not report when optional chaining #2253

Open
mcenkar opened this issue Jan 12, 2024 · 0 comments

Comments

@mcenkar
Copy link

mcenkar commented Jan 12, 2024

Similar to #2252 but on unicorn/no-invalid-remove-event-listener

Rule works correctly without optional chaining:

image

However with optional chaining stops reporting error:

image
this.input?.removeEventListener(event, this.onInputEvent.bind(this), true)

Can be easily tested by adding ? after el: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/f0ff04d/test/no-invalid-remove-event-listener.mjs#L49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants