💼 This rule is enabled in the 📋 template-lint-migration config.
Disallow invalid meta tags.
Meta tags must be well-formed and follow accessibility/usability best practices.
This rule checks <meta> elements for the following issues:
- Invalid charset —
charsetmust beutf-8(case-insensitive). - Missing
content— Ifname,property,itemprop, orhttp-equivis present, acontentattribute is required. - Missing identifier — If
contentis present, one ofname,property,itemprop,http-equiv, orcharsetmust also be present. http-equiv="refresh"redirect delay — A meta refresh that redirects (contains;) must have a delay of0.http-equiv="refresh"plain delay — A meta refresh without a redirect must have a delay greater than 72000 seconds.- Viewport
user-scalable=no— Disabling user scaling harms accessibility. - Viewport
maximum-scale— Setting a maximum scale restricts zooming.
Sometimes a page automatically redirects to a different page. When this happens after a timed delay, it is an unexpected change of context that may interrupt the user. Redirects without timed delays are okay, but please consider a server-side method for redirecting instead (method will vary based on your server type).
When content is presented with a restriction to a specific orientation, users must orient their devices to view the content in the orientation that the author imposed. Some users have their devices mounted in a fixed orientation (e.g. on the arm of a power wheelchair), and if the content cannot be viewed in that orientation it creates problems for the user.
<template>
<meta charset="iso-8859-1" />
</template><template>
<meta name="description" />
</template>Missing content when name is present.
<template>
<meta content="some value" />
</template>Missing identifier (name, property, itemprop, or http-equiv) when content is present.
<template>
<meta http-equiv="refresh" content="5;url=https://example.com" />
</template>Redirect delay must be 0.
<template>
<meta http-equiv="refresh" content="30" />
</template>Plain refresh delay must be greater than 72000.
<template>
<meta name="viewport" content="width=device-width, user-scalable=no" />
</template><template>
<meta name="viewport" content="width=device-width, maximum-scale=1" />
</template><template>
<meta charset="utf-8" />
</template><template>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</template><template>
<meta name="description" content="A description of the page" />
</template><template>
<meta http-equiv="refresh" content="0;url=https://example.com" />
</template>- To fix, reduce the timed delay to zero, or use the appropriate server-side redirect method for your server type.
- To fix orientation issues, remove references to
maximum-scale=1.0and changeuser-scalable=notouser-scalable=yes.