require meta refresh to have 0 second delay (meta-refresh)

The <meta http-equiv="refresh" content=".."> directive can be used to refresh or redirect the page. For users with assistive technology a forced refresh or redirect after a fixed duration can render the user unable to read and understand the content in time.

Generally the directive should be avoided all together but under some situations it is unavoidable (e.g. a static page generator hosted on git-based hosting solutions don't provide an alternative for server-based redirection are forced to use client-side redirection).

WCAG H76 requires the interval to be set to exactly 0 as to do the redirection before any content is rendered to the client.

This rule prevents non-zero time intervals and using the directive to refresh the page as it would be stuck in an infinite loop refreshing the same page over and over again.

Rule details

Examples of incorrect code for this rule:

<meta http-equiv="refresh" content="5;url=target.html">
error: Meta refresh must use 0 second delay (meta-refresh) at inline:1:37:
> 1 | <meta http-equiv="refresh" content="5;url=target.html">
    |                                     ^^^^^^^^^^^^^^^^^

1 error found.

<meta http-equiv="refresh" content="0">
error: Don't use meta refresh to reload the page (meta-refresh) at inline:1:37:
> 1 | <meta http-equiv="refresh" content="0">
    |                                     ^

1 error found.

Examples of correct code for this rule:

<meta http-equiv="refresh" content="0;url=target.html">