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

detect deprecated addEventListener properties #568

Open
NovemLinguae opened this issue Apr 23, 2024 · 0 comments
Open

detect deprecated addEventListener properties #568

NovemLinguae opened this issue Apr 23, 2024 · 0 comments

Comments

@NovemLinguae
Copy link

NovemLinguae commented Apr 23, 2024

https://w3c.github.io/uievents/#legacy-event-types

List of deprecated event types:

  • Mutation events
    • DOMAttrModified
    • DOMAttributesNameChanged
    • DOMCharacterDataModified
    • DOMElementNameChanged
    • DOMNodeInserted
    • DOMNodeInsertedIntoDocument
    • DOMNodeRemoved
    • DOMNodeRemovedFromDocument
    • DOMSubtreeModified
  • DOMActivate
  • DOMFocusIn
  • DOMFocusOut
  • keypress
  • textInput

Codesearch has about 50 results in our codebases

Testcases that should match a new rule:

element.addEventListener( 'keypress', function () {
element.removeEventListener( 'keypress', function () {
$element.on( 'keypress', function () {
$element.off( 'keypress', function () {
element.addEventListener( 'click keypress blur', function () {
element.removeEventListener( 'click keypress blur', function () {
$element.on( 'click keypress blur', function () {
$element.off( 'click keypress blur', function () {

Chrome JS console warns about DOMNodeInserted (and I assume the others)

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

No branches or pull requests

1 participant