webhook-action/node_modules/eslint-plugin-github/lib/rules/no-blur.js
2022-11-10 20:43:16 +10:00

20 lines
482 B
JavaScript

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow usage of `Element.prototype.blur()`',
url: require('../url')(module)
},
schema: []
},
create(context) {
return {
CallExpression(node) {
if (node.callee.property && node.callee.property.name === 'blur') {
context.report({node, message: 'Do not use element.blur(), instead restore the focus of a previous element.'})
}
}
}
}
}