webhook-action/node_modules/eslint-plugin-github/lib/rules/no-blur.js

20 lines
486 B
JavaScript
Raw Normal View History

2022-11-10 10:43:16 +00:00
module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow usage of `Element.prototype.blur()`',
2024-03-28 02:00:41 +00:00
url: require('../url')(module),
2022-11-10 10:43:16 +00:00
},
2024-03-28 02:00:41 +00:00
schema: [],
2022-11-10 10:43:16 +00:00
},
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.'})
}
2024-03-28 02:00:41 +00:00
},
}
2024-03-28 02:00:41 +00:00
},
}