Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 410 Bytes

prefer-text-content.md

File metadata and controls

18 lines (11 loc) · 410 Bytes

Prefer .textContent over .innerText

Enforces the use of .textContent over .innerText for DOM nodes. There are some advantages of using .textContent, like performance and more predictable behavior when updating it.

This rule is fixable.

Fail

foo.innerText = '🦄';

Pass

foo.textContent = '🦄';