JavaScript

JavaScript

Made by DeepSource

Prefer explicit role property in HTML tags JS-0764

Performance
Minor

Some HTML elements have native semantics that are implemented by the browser. This includes default/implicit ARIA roles. Setting an ARIA role that matches its default/implicit role is redundant since it is already set by the browser.

Bad Practice

<button role="button" />
<img role="img" src="foo.jpg" />

Recommended

<div />
<button role="presentation" />
<MyComponent role="main" />