mirror of
https://github.com/github/codeql-action.git
synced 2025-12-22 15:20:19 +08:00
22 lines
545 B
JavaScript
22 lines
545 B
JavaScript
module.exports = {
|
|
meta: {
|
|
type: 'problem',
|
|
docs: {
|
|
description: 'disallow `Element.prototype.innerHTML` in favor of `Element.prototype.textContent`',
|
|
url: require('../url')(module),
|
|
},
|
|
schema: [],
|
|
},
|
|
|
|
create(context) {
|
|
return {
|
|
'MemberExpression[property.name=innerHTML]': function (node) {
|
|
context.report({
|
|
node: node.property,
|
|
message: 'Using innerHTML poses a potential security risk and should not be used. Prefer using textContent.',
|
|
})
|
|
},
|
|
}
|
|
},
|
|
}
|