Update checked-in dependencies
This commit is contained in:
parent
6b0d45a5c6
commit
cc1adb825a
4247 changed files with 144820 additions and 149530 deletions
11
node_modules/eslint-plugin-github/lib/rules/require-passive-events.js
generated
vendored
11
node_modules/eslint-plugin-github/lib/rules/require-passive-events.js
generated
vendored
|
|
@ -4,18 +4,23 @@ const propIsPassiveTrue = prop => prop.key && prop.key.name === 'passive' && pro
|
|||
|
||||
module.exports = {
|
||||
meta: {
|
||||
docs: {}
|
||||
type: 'suggestion',
|
||||
docs: {
|
||||
description: 'enforce marking high frequency event handlers as passive',
|
||||
url: require('../url')(module)
|
||||
},
|
||||
schema: []
|
||||
},
|
||||
|
||||
create(context) {
|
||||
return {
|
||||
['CallExpression[callee.property.name="addEventListener"]']: function(node) {
|
||||
['CallExpression[callee.property.name="addEventListener"]']: function (node) {
|
||||
const [name, listener, options] = node.arguments
|
||||
if (!listener) return
|
||||
if (name.type !== 'Literal') return
|
||||
if (!passiveEventListenerNames.has(name.value)) return
|
||||
if (options && options.type === 'ObjectExpression' && options.properties.some(propIsPassiveTrue)) return
|
||||
context.report(node, `High Frequency Events like "${name.value}" should be \`passive: true\``)
|
||||
context.report({node, message: `High Frequency Events like "${name.value}" should be \`passive: true\``})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue