Skip to content

Commit

Permalink
Update index.js (#11625)
Browse files Browse the repository at this point in the history
  • Loading branch information
patmmccann authored May 30, 2024
1 parent 7619d0a commit 3416799
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions plugins/eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@ const { flagErrors } = require('./validateImports.js');

module.exports = {
rules: {
'no-outerText': {
meta: {
docs: {
description: '.outerText property on DOM elements should not be used due to performance issues'
},
messages: {
noInnerText: 'Use of `.outerText` is not allowed. Use `.textContent` instead.',
}
},
create: function(context) {
return {
MemberExpression(node) {
if (node.property && node.property.name === 'outerText') {
context.report({
node: node.property,
messageId: 'noOuterText',
});
}
}
}
}
},
'no-innerText': {
meta: {
docs: {
Expand Down

0 comments on commit 3416799

Please sign in to comment.