mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
26 lines
532 B
JavaScript
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')
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|