diff --git a/docs/rules/no-useless-passive.md b/docs/rules/no-useless-passive.md index edf43ec0..52cff7c1 100644 --- a/docs/rules/no-useless-passive.md +++ b/docs/rules/no-useless-passive.md @@ -2,7 +2,7 @@ This rule disallows setting `passive: true` for events on which it will have no effect. -Events where `passive: true` has an effect are: `touchstart`, `touchmove`, `wheel`, and `mousewheel`. +Events where `passive: true` has an effect are: `touchstart`, `touchmove`, `touchenter`, `touchend`, `touchleave`, `wheel`, and `mousewheel`. ## Rule Details diff --git a/docs/rules/require-passive-events.md b/docs/rules/require-passive-events.md index e94eca86..aa01b545 100644 --- a/docs/rules/require-passive-events.md +++ b/docs/rules/require-passive-events.md @@ -1,6 +1,6 @@ # Require Passive Events -This rule enforces adding `passive: true` to high frequency event listeners (`touchstart`, `touchmove`, `wheel`, `mousewheel`). +This rule enforces adding `passive: true` to high frequency event listeners (`touchstart`, `touchmove`, `touchenter`, `touchend`, `touchleave`, `wheel`, `mousewheel`). ## Rule Details diff --git a/lib/rules/no-useless-passive.js b/lib/rules/no-useless-passive.js index d53b2047..5fd8dc18 100644 --- a/lib/rules/no-useless-passive.js +++ b/lib/rules/no-useless-passive.js @@ -1,4 +1,12 @@ -const passiveEventListenerNames = new Set(['touchstart', 'touchmove', 'wheel', 'mousewheel']) +const passiveEventListenerNames = new Set([ + 'touchstart', + 'touchmove', + 'touchenter', + 'touchend', + 'touchleave', + 'wheel', + 'mousewheel' +]) const propIsPassiveTrue = prop => prop.key && prop.key.name === 'passive' && prop.value && prop.value.value === true diff --git a/lib/rules/require-passive-events.js b/lib/rules/require-passive-events.js index bce8787b..5e6314db 100644 --- a/lib/rules/require-passive-events.js +++ b/lib/rules/require-passive-events.js @@ -1,4 +1,12 @@ -const passiveEventListenerNames = new Set(['touchstart', 'touchmove', 'wheel', 'mousewheel']) +const passiveEventListenerNames = new Set([ + 'touchstart', + 'touchmove', + 'touchenter', + 'touchend', + 'touchleave', + 'wheel', + 'mousewheel' +]) const propIsPassiveTrue = prop => prop.key && prop.key.name === 'passive' && prop.value && prop.value.value === true