Skip to content

Conversation

manuelpuyol
Copy link
Contributor

Adds a rule that disallows the usage of innerHTML with some kind of content.
The only allowed use is innerHTML = ''

// bad
function setContent(element, content) {
  element.innerHTML = content
}
// good
function clearContent(element) {
  element.innerHTML = ''
}

@manuelpuyol manuelpuyol requested a review from a team as a code owner September 9, 2021 19:47
Copy link
Contributor

@dgreif dgreif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a great rule to add!

@manuelpuyol manuelpuyol merged commit 21bdd7f into main Sep 9, 2021
@dgreif dgreif deleted the no-innerHTML branch September 9, 2021 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants