sindresorhus/eslint-plugin-unicorn
`unicorn/no-invalid-remove-event-listener` does not report when optional chaining
已关闭
#2,253 创建于 2024年1月12日
bughelp wanted
仓库指标
- 星标
- (5,022 个星标)
- PR 合并指标
- (平均合并 1天 16小时) (30 天内合并 399 个 PR)
描述
Similar to #2252 but on unicorn/no-invalid-remove-event-listener
Rule works correctly without optional chaining:
However with optional chaining stops reporting error:
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