Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelpuyol committed Sep 9, 2021
1 parent 2599d2a commit 4ba1cba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rules/no-inner-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ module.exports = {
create(context) {
return {
AssignmentExpression(node) {
if (node.operator === "=") {
const leftNode = node.left;
const rightNode = node.right;
if (node.operator === '=') {
const leftNode = node.left
const rightNode = node.right

if (leftNode.property && leftNode.property.name === 'innerHTML') {
if (rightNode.type === 'Literal' && rightNode.value === '') {
return
}

context.report({
node: node,
node,
message:
'Using innerHTML poses a potential security risk and should not be used other than cleaning content.'
})
Expand Down

0 comments on commit 4ba1cba

Please sign in to comment.