Rule request: no-autoplay
A rule which gives an error when using <audio>
and <video>
with the autoplay
attribute.
Autoplay can be disturbing for users and have accessibility concerns.
The rule should be enabled by default.
Examples
Valid:
<audio ..></audio>
<video ..></video>
Invalid:
<audio autoplay ..></audio>
<video autoplay ..></video>
Options
-
include
for a list of elements to include, defaultnull
-
exclude
for a list of elements to exclude, defaultnull
Both options should work with a default list of ["audio", "video"]
and should not be mutually exclusive. See other rules such as prefer-native
.