Disallow Element.prototype.innerText in favor of Element.prototype.textContent (github/no-innerText)

February 8, 2023 ยท View on GitHub

๐Ÿ’ผ This rule is enabled in the ๐Ÿ” browser config.

๐Ÿ”ง This rule is automatically fixable by the --fix CLI option.

Rule Details

๐Ÿ‘Ž Examples of incorrect code for this rule:

const el = document.createElement('div')
el.innerText = 'foo'

๐Ÿ‘ Examples of correct code for this rule:

const el = document.createElement('div')
el.textContent = 'foo'

Version

4.3.2