Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 416 Bytes

prefer-text-content.md

File metadata and controls

18 lines (11 loc) · 416 Bytes

Prefer textContent over innerText

Enforces the use of node.textContent over node.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 = '🦄';