Enforce usage of Element.prototype.getAttribute instead of Element.prototype.datalist (github/no-dataset)

February 8, 2023 ยท View on GitHub

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

Rule Details

Due to camel-case transformations, using dataset is not easily greppable. Instead, use el.getAttribute('data-what-ever').

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

el.dataset.coolThing

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

el.getAttribute('data-cool-thing')

Version

4.3.2