webhook/node_modules/eslint-plugin-github/lib/rules/no-innerText.js
Joel Male 1ada95e04a
v2.0.0 (#12)
- Convert project to Javascript/Typescript
- Allow custom headers to be passed in (optional)
- Allow body to be optional
2020-08-26 10:52:47 +10:00

25 lines
532 B
JavaScript

module.exports = {
meta: {
docs: {},
fixable: 'code'
},
create(context) {
return {
MemberExpression(node) {
if (node.property && node.property.name === 'innerText') {
context.report({
meta: {
fixable: 'code'
},
node: node.property,
message: 'Prefer textContent to innerText',
fix(fixer) {
return fixer.replaceText(node.property, 'textContent')
}
})
}
}
}
}
}