github-pages-deploy-action/node_modules/eslint-plugin-github/lib/rules/no-innerText.js
2020-03-31 08:42:07 -04:00

26 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')
}
})
}
}
}
}
}