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

20 lines
503 B
JavaScript

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'enforce usage of `Element.prototype.getAttribute` instead of `Element.prototype.datalist`',
url: require('../url')(module)
},
schema: []
},
create(context) {
return {
MemberExpression(node) {
if (node.property && node.property.name === 'dataset') {
context.report({node, message: "Use getAttribute('data-your-attribute') instead of dataset."})
}
}
}
}
}