Open Bug 1348940 Opened 8 years ago Updated 2 years ago

mozilla/no-useless-removeEventListener should also work for addEventListener/removeEventListener globals

Categories

(Developer Infrastructure :: Lint and Formatting, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: Gijs, Unassigned)

References

Details

For code that looks like this: addEventListener("foo", function bar() { removeEventListener("foo", bar); }); like in https://dxr.mozilla.org/mozilla-central/rev/1b9293be51637f841275541d8991314ca56561a5/browser/components/preferences/in-content/preferences.js#53-56 , no warning is given. When I changed the code to use document.* listeners instead, eslint complained. This caught me out in bug 1348623 (happily, on try rather than when landing). The eslint plugin should catch the global variant, too.
Blocks: 1331599
Priority: -- → P3
Product: Testing → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.