Skip to main content

Using Presets

Presets are curated sets of rules that you can apply with a single line of configuration. Instead of enabling rules one by one, specify a preset in the extends property:

{
"extends": ["markuplint:recommended"]
}

Which preset should I use?

Choose based on your project type:

Project typeRecommended preset
Static HTML (no framework)markuplint:recommended-static-html
React / Next.js / Preactmarkuplint:recommended-react
Vue / Nuxtmarkuplint:recommended-vue
Svelte / SvelteKitmarkuplint:recommended-svelte
Other / General purposemarkuplint:recommended

All recommended presets include the same base presets (a11y, html-standard, performance, rdfa, security), plus framework-specific rules where applicable.

Applying presets

  • markuplint:recommended
  • markuplint:recommended-static-html
  • markuplint:recommended-react
  • markuplint:recommended-vue
  • markuplint:recommended-svelte

These recommended presets include all base presets and each has framework-specific rulesets (e.g., markuplint:recommended-static-html, markuplint:recommended-react) except markuplint:recommended.

Base presets

You can also pick individual base presets if you want fine-grained control:

  • markuplint:a11y
  • markuplint:html-standard
  • markuplint:performance
  • markuplint:rdfa
  • markuplint:security
{
"extends": ["markuplint:html-standard", "markuplint:a11y"]
}

See rulesets below for what each preset includes.

Named rules in presets

Some checks in presets are defined as named rules. Named rules have a name in the namespace/rule-name format, which appears in violation reports (e.g., a11y/html-lang).

You can use the rules property to disable, change severity, or bulk-disable named rules by namespace wildcard:

{
"extends": ["markuplint:recommended"],
"rules": {
// Disable a specific named rule
"a11y/html-lang": false,

// Change severity of a named rule
"a11y/no-autofocus-outside-dialog": { "severity": "warning" },

// Disable all named rules in a namespace
"a11y/*": false
}
}

When multiple presets wrap the same base rule (e.g., a11y/id-duplication and html-standard/id-duplication), both run independently and report separate violations. You can control each one individually.

See the rulesets tables below for the full list of named rules.

Preset rulesets

markuplint:a11y

Named RuleDescription
a11y/id-duplicationWarns when id attribute values are duplicated in one document. Avoids problems in assistive technologies from the viewpoint of machine readability.
a11y/no-refer-to-non-existent-idChecks whether IDs specified in for, form, aria-*, and more reference an ID that exists in the same document.
a11y/no-broken-fragment-linkChecks whether a fragment in a hyperlink references an ID that exists in the same document.
a11y/wai-aria/unsupported-elementDisallows ARIA attributes on elements that don't support ARIA at all.
a11y/wai-aria/non-existent-roleWarns when a role attribute value does not exist in the WAI-ARIA specification.
a11y/wai-aria/abstract-roleWarns when an abstract WAI-ARIA role is used.
a11y/wai-aria/permitted-rolesWarns when a role is not permitted on the element according to ARIA in HTML.
a11y/wai-aria/implicit-roleWarns when the explicit role attribute duplicates the element's implicit role.
a11y/wai-aria/implicit-propsWarns when an ARIA property redundantly restates the same semantics as an equivalent native HTML attribute.
a11y/wai-aria/contradictory-propsWarns when an ARIA property's value contradicts an equivalent native HTML attribute.
a11y/wai-aria/required-propsWarns when required ARIA properties for a role are missing.
a11y/wai-aria/disallowed-propsWarns when an ARIA property or state is disallowed on the element's computed role.
a11y/wai-aria/prohibited-namingWarns when aria-label, aria-labelledby, or aria-braillelabel is used on a naming-prohibited element.
a11y/wai-aria/element-supports-aria-propWarns when an ARIA property or state is disallowed by an element-specific ARIA in HTML restriction.
a11y/wai-aria/deprecated-roleWarns when a deprecated WAI-ARIA role is used.
a11y/wai-aria/deprecated-propsWarns when a deprecated ARIA property or state is used on a role.
a11y/wai-aria/valueWarns when an ARIA property or state value does not conform to its expected type.
a11y/wai-aria/required-owned-elementsWarns when a role does not contain its required child roles.
a11y/wai-aria/required-parent-roleWarns when an element with an explicit role is placed outside its required parent context.
a11y/wai-aria/tab-requires-tabpanelWarns when an active "tab" role element has no corresponding "tabpanel" role element.
a11y/wai-aria/presentational-childrenWarns when ARIA attributes are set on descendants of roles with presentational children.
a11y/wai-aria/no-global-propWarns when a non-global ARIA property is used on an element without an explicit role.
a11y/wai-aria/default-valueWarns when an ARIA property is explicitly set to its spec-defined default value.
a11y/wai-aria/interaction-in-hiddenWarns when focusable interactive elements are placed inside an aria-hidden subtree.
a11y/require-accessible-nameWarns if the element has no accessible name according to its ARIA role.
a11y/redundant-accessible-nameDetects elements with multiple accessible name sources where a higher-priority source overrides a lower-priority one.
a11y/label-has-controlWarns if the <label> element has no associated control.
a11y/landmark-rolesChecks that banner, main, and contentinfo are top-level landmarks.
a11y/require-landmark-labelChecks that landmarks with a duplicated role have unique accessible names.
a11y/required-h1Warns if there is no <h1> element in the document.
a11y/no-duplicate-h1Warns if there is more than one <h1> element in the document.
a11y/html-langRequires the lang attribute on the <html> element for assistive technologies to identify the document language.
a11y/abbr-titleRequires the title attribute on <abbr> elements to provide the full expansion of abbreviations.
a11y/media-trackRequires <track> elements in <audio> and <video> for captions and descriptions.
a11y/video-autoplay-mutedRequires <video> elements with autoplay to also have the muted attribute to prevent unexpected audio.
a11y/no-accesskeyDisallows the accesskey attribute as it can cause accessibility issues due to conflicts with assistive technology shortcuts.
a11y/tabindex-restrictRestricts the tabindex attribute to only -1 or 0 values to prevent disrupting natural tab order.
a11y/no-autofocus-outside-dialogDon't take away focus forcibly. However, the dialog element and its descendants allow it.
a11y/viewport-no-user-scalableDisallows user-scalable=no in viewport meta tag as it prevents zooming for users with low vision.
a11y/no-consecutive-brWarns against the use of consecutive <br> tags. Use CSS margins or appropriate block elements instead.
a11y/no-ambiguous-navigable-target-namesPrevents typographical errors in links that could replace special navigational keywords like _blank with invalid target names.
a11y/use-listPrompts to use a list element when a bullet character appears at the start of a text node.
a11y/table-row-column-alignmentEnsures consistency in the defined number of rows and columns, accounting for colspan and rowspan.
a11y/no-table-cell-overlapDisallows rowspan / colspan values that cause two cells to cover the same slot.
a11y/no-table-span-overflowDisallows a rowspan that reaches past the end of its <thead>, <tbody>, or <tfoot>.
a11y/no-empty-table-trackDisallows a table row or column that no cell is anchored to.
a11y/no-merge-cellsDisallows colspan and rowspan attributes on table cells to prevent merged cells that are difficult for assistive technologies.
a11y/neighbor-popoversWarns when popover triggers and their corresponding targets are not adjacent in the DOM.
a11y/summary-no-interactiveThere is a case where an assistive technology can't access contents, or contents don't propagate a mouse event to <summary>.
a11y/require-dialog-autofocusRequires a dialog shown via the showModal() method to contain an element with the autofocus attribute.

markuplint:html-standard

Also enables the base rules no-unknown-attr, no-disallowed-attr, and no-invalid-attr-value for spec-based attribute validation. Named rules that restrict specific attributes (such as a11y/no-accesskey) wrap no-restricted-attr instead — that rule only enforces its own configured denylist and never performs spec validation, so it stays narrow no matter where it's used.

Named RuleDescription
html-standard/id-duplicationWarns when id attribute values are duplicated in one document.
html-standard/no-refer-to-non-existent-idChecks whether IDs specified in for, form, aria-*, and more reference an ID that exists in the same document.
html-standard/attr-duplicationThe parser ignores all such duplicate occurrences of the attribute.
html-standard/deprecated-attrAuthors must not use attributes the HTML spec has removed entirely (obsolete, non-conforming features).
html-standard/no-deprecated-attrWarns on attributes MDN/BCD marks as deprecated (still defined by the spec, but discouraged).
html-standard/deprecated-elementAuthors must not use elements the HTML spec has removed entirely (obsolete, non-conforming features).
html-standard/no-deprecated-elementWarns on elements MDN/BCD marks as deprecated (still defined by the spec, but discouraged).
html-standard/doctypeIt has the effect of avoiding quirks mode.
html-standard/no-obsolete-doctypeAuthors must not use an obsolete DOCTYPE (a public identifier, or a system identifier other than the one legacy-string exception the spec permits).
html-standard/permitted-contentsWarns if a child element is not allowed by the HTML specification for its parent element.
html-standard/no-disallowed-ancestorWarns if an element appears as a descendant of an ancestor its content model forbids (e.g. <address> inside <address>).
html-standard/require-ancestorWarns if an element appears outside a required ancestor (e.g. <area> outside <map>).
html-standard/no-duplicate-sibling-attrWarns if an attribute the content model marks as sibling-unique appears on more than one element of the same type within the same parent.
html-standard/required-attrWarns if required attributes defined by the HTML specification are not present on an element.
html-standard/ineffective-attrWarns when a specified attribute has no effect on the element (e.g., disabled on a <div>).
html-standard/no-orphaned-end-tagWarns when an end tag appears without a corresponding start tag, which constitutes an inner parse error.
html-standard/heading-levelsEach heading must be equal to or one level greater than the previous heading.
html-standard/no-duplicate-dtWithin a single <dl> element, there should not be more than one <dt> element for each name.
html-standard/placeholder-label-optionChecks whether the <select> element needs the placeholder label option (first <option> with an empty value).
html-standard/require-datetimeWarns that the datetime attribute is needed if the <time> element has content that is not a valid date/time string.
html-standard/srcset-sizes-constraintRequires sizes wherever srcset uses width descriptors, and vice versa.
html-standard/no-mixed-srcset-descriptorsDisallows mixing width and pixel density descriptors in a srcset attribute.
html-standard/sizes-auto-requires-lazy-loadingRequires loading="lazy" wherever sizes="auto" is used.
html-standard/no-always-matching-sourceRequires a distinguishing media or type on a <source> with a following srcset-bearing sibling.
html-standard/head-charset-utf8Requires a <meta charset="UTF-8"> element in the document head.
html-standard/no-small-in-headingShould not use <small> in <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>.
html-standard/figure-no-captionWhen <table> is the only content in <figure> other than <figcaption>, <caption> should be omitted in favor of <figcaption>.
html-standard/input-pattern-titleWhen an <input> element has a pattern attribute specified, authors should include a title attribute to give a description of the pattern.
html-standard/no-nested-details-nameA document must not contain a <details> element that is a descendant of another <details> element in the same name group.
html-standard/no-shortcut-iconThe shortcut keyword in <link rel> is unnecessary. Use rel="icon" instead.

markuplint:performance

Named RuleDescription
performance/head-charset-utf8Requires a <meta charset="UTF-8"> element in the document head.
performance/script-deferShould load and parse scripts lazily to avoid render-blocking.
performance/img-aspect-ratioRequires width and height attributes on <img> to avoid Cumulative Layout Shift.
performance/iframe-lazy-loadingRequires loading=lazy on <iframe> to avoid render-blocking when the element is out of the viewport.

markuplint:rdfa

Extends no-unknown-attr, no-disallowed-attr, and no-invalid-attr-value to allow the property and content attributes on <meta property> so that RDFa-based metadata (e.g., Open Graph) does not trigger spec-validation violations. Also disables require-attr on the same elements.

No named rules are exposed by this preset.

markuplint:recommended-static-html

Includes all base presets plus the following rules:

Named RuleDescription
static-html/character-referenceWarns when a literal < in a text node or attribute value isn't escaped with a character reference.
static-html/no-malformed-character-referenceWarns when a &...;-shaped character reference is malformed (unknown name, missing semicolon, invalid numeric reference).
static-html/end-tagRecommends always writing end tags because it is too difficult for a human to decide whether an element's end tag is omittable.

markuplint:recommended-react

Includes all base presets plus the following rules:

Named RuleDescription
react/no-hard-code-idComponents with hard-coded IDs cannot be mounted multiple times because IDs must be unique in a document. Use dynamic IDs instead.

markuplint:recommended-vue

Includes all base presets plus the following rules:

Named RuleDescription
vue/no-hard-code-idComponents with hard-coded IDs cannot be mounted multiple times because IDs must be unique in a document. Use dynamic IDs instead.

markuplint:recommended-svelte

Includes all base presets plus the following rules:

Named RuleDescription
svelte/no-hard-code-idComponents with hard-coded IDs cannot be mounted multiple times because IDs must be unique in a document. Use dynamic IDs instead.

Next steps

  • Applying Rules — Customize preset rules or add individual rules
  • Beyond HTML — Set up parsers for JSX, Vue, Svelte, and more
  • Configuration — Learn about configuration file formats and properties