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

21 lines
503 B
JavaScript
Raw Normal View History

module.exports = {
meta: {
2022-11-10 11:43:16 +01:00
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') {
2022-11-10 11:43:16 +01:00
context.report({node, message: "Use getAttribute('data-your-attribute') instead of dataset."})
}
}
}
}
}