HTML ESLint

HTML ESLint

  • Docs
  • GitHub
  • PlayGround

›Rules

Getting Started

  • Getting Started

Disabling with inline comments

  • Disable rules with inline comments

CLI (Check HTML file on URL)

  • CLI (Run on URLs)

Rules

  • All Rules
  • SEO

    • @html-eslint/require-lang
    • @html-eslint/require-title
    • @html-eslint/no-multiple-h1
    • @html-eslint/require-meta-description

    Style

    • @html-eslint/no-extra-spacing-attrs
    • @html-eslint/element-newline
    • @html-eslint/indent
    • @html-eslint/quotes
    • @html-eslint/id-naming-convention
    • @html-eslint/no-multiple-empty-lines

    Best Practice

    • @html-eslint/require-doctype
    • @html-eslint/no-duplicate-id
    • @html-eslint/no-inline-styles
    • @html-eslint/require-li-container
    • @html-eslint/no-obsolete-tags
    • @html-eslint/require-closing-tags
    • @html-eslint/require-meta-charset
    • @html-eslint/no-target-blank
    • @html-eslint/no-duplicate-attrs
    • @html-eslint/require-button-type
    • @html-eslint/no-restricted-attrs

    Accessibility

    • @html-eslint/require-img-alt
    • @html-eslint/no-skip-heading-levels
    • @html-eslint/require-frame-title
    • @html-eslint/no-non-scalable-viewport
    • @html-eslint/no-positive-tabindex
    • @html-eslint/require-meta-viewport
    • @html-eslint/no-abstract-roles
    • @html-eslint/no-aria-hidden-body
    • @html-eslint/no-accesskey-attrs

All Rules

  • 🔧 - Meaning the rule can fix problems aotomatically by running eslint --fix options.
  • ⭐ - Meaning the rule is recommended.

Best Pracice

ruledescription
@html-eslint/require-doctypeRequire <!DOCTYPE HTML> in html,⭐🔧
@html-eslint/no-duplicate-idDisallow to use duplicate id⭐
@html-eslint/no-inline-stylesDisallow using inline style
@html-eslint/require-li-containerEnforce <li> to be in <ul>, <ol> or <menu>.⭐
@html-eslint/no-obsolete-tagsDisallow to use obsolete elements in HTML5⭐
@html-eslint/require-closing-tagsRequire closing tags.⭐🔧
@html-eslint/require-meta-charsetEnforce to use <meta name="chartset"> in <head>
@html-eslint/no-target-blankDisallow usage of unsafe target='_blank'
@html-eslint/no-duplicate-attrsDisallow to use duplicate attributes⭐
@html-eslint/require-button-typeRequire use of button element with a valid type attribute.
@html-eslint/no-restricted-attrsDisallow specified attributes

SEO

ruledescription
@html-eslint/require-langRequire lang attribute at <html> tag⭐
@html-eslint/require-titleRequire <title><title/> in the <head><head/>⭐
@html-eslint/no-multiple-h1Disallow multiple <h1></h1>.⭐
@html-eslint/require-meta-descriptionRequire use of <meta name="description"> in <head>

Accessibility

ruledescription
@html-eslint/require-img-altRequire alt attribute at <img> tag⭐
@html-eslint/no-skip-heading-levelsDisallow skipping heading levels
@html-eslint/require-frame-titleRequire title in <frame>, <iframe>
@html-eslint/no-non-scalable-viewportDisallow use of user-scalable=no in <meta name="viewport">.
@html-eslint/no-positive-tabindexDisallow use of positive tabindex.
@html-eslint/require-meta-viewportEnforce to use <meta name="viewport"> in <head>
@html-eslint/no-abstract-rolesDisallow to use of abstract roles
@html-eslint/no-aria-hidden-bodyDisallow to use aria-hidden attributes on the body element.
@html-eslint/no-accesskey-attrsDisallow to use of accesskey attribute

Styles

ruledescription
@html-eslint/no-extra-spacing-attrsDisallow an extra spacing around attributes⭐🔧
@html-eslint/element-newlineEnforce newline between elements.⭐🔧
@html-eslint/indentEnforce consistent indentation⭐🔧
@html-eslint/quotesEnforce consistent quoting attributes with double(") or single(')⭐🔧
@html-eslint/id-naming-conventionEnforce consistent naming id attributes
@html-eslint/no-multiple-empty-linesDisallow multiple empty lines🔧
← CLI (Run on URLs)@html-eslint/require-lang →
Docs
Getting StartedAll Rules
More
GitHubStar
Built with Docusaurus