Skip to content

Commit 4893dad

Browse files
boris-petrovdgreif
authored andcommitted
Update events handled by require-passive-events
1 parent c54cec9 commit 4893dad

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/rules/require-passive-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Require Passive Events
22

3-
This rule enforces adding `passive: true` to high frequency event listeners (`touchstart`, `touchmove`, `wheel`, `mousewheel`).
3+
This rule enforces adding `passive: true` to high frequency event listeners (`touchstart`, `touchmove`, `touchenter`, `touchend`, `touchleave`, `wheel`, `mousewheel`).
44

55
## Rule Details
66

lib/rules/require-passive-events.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
const passiveEventListenerNames = new Set(['touchstart', 'touchmove', 'wheel', 'mousewheel'])
1+
const passiveEventListenerNames = new Set([
2+
'touchstart',
3+
'touchmove',
4+
'touchenter',
5+
'touchend',
6+
'touchleave',
7+
'wheel',
8+
'mousewheel'
9+
])
210

311
const propIsPassiveTrue = prop => prop.key && prop.key.name === 'passive' && prop.value && prop.value.value === true
412

0 commit comments

Comments
 (0)