Hamburger Cross Icon
HTML Collector - Lunar Collector

HTML Collector

Collector Beta Languages

Detect HTML, CSS, SCSS, and LESS files, run HTMLHint and Stylelint for code quality analysis. Categorize frontend markup projects and surface lint issues for policy enforcement.

Add html to your lunar-config.yml:
uses: github://earthly/lunar-lib/collectors/html@v1.0.5

What This Integration Collects

This integration includes 3 collectors that gather metadata from your systems.

Collector code

project

Scans the repository for HTML and CSS-family files (.html, .css, .scss, .less). Counts files of each type and writes a separate .lang. entry per detected type. Skips gracefully if no matching files are found.

html css scss less frontend web markup stylesheet
Book a demo
Collector code

htmlhint

Runs HTMLHint on all .html files to catch common issues: unclosed tags, missing attributes, accessibility problems. Writes normalized warnings to .lang.html.lint and raw output to .lang.html.native.htmlhint.

htmlhint html linting accessibility markup quality
Book a demo
Collector code

stylelint

Runs Stylelint on CSS, SCSS, and LESS files to catch invalid properties, formatting issues, and common mistakes. Writes normalized warnings to .lang.css.lint and raw output to .lang.css.native.stylelint.

stylelint css linting scss less stylesheet quality
Book a demo

How Collectors Fit into Lunar

Lunar watches your code and CI/CD systems to collect SDLC data from config files, test results, IaC, deployment configurations, security scans, and more.

Collectors are the automatic data-gathering layer. They extract structured metadata from your repositories and pipelines, feeding it into Lunar's centralized database where guardrails evaluate it to enforce your engineering standards.

Learn How Lunar Works
1
Collectors Gather Data This Integration
Triggered by code changes or CI pipelines, collectors extract metadata from config files, tool outputs, test results, and scans
2
{ } Centralized as JSON
All data merged into each component's unified metadata document
3
Guardrails Enforce Standards
Real-time feedback in PRs and AI workflows

Example Collected Data

This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:

{ } component.json Component JSON
{
  "lang": {
    "html": {
      "file_count": 12,
      "source": { "tool": "html", "integration": "code" },
      "lint": {
        "warnings": [
          {
            "file": "index.html",
            "line": 15,
            "severity": "warning",
            "message": "Tag must be paired, missing: </div>",
            "rule": "tag-pair"
          }
        ],
        "tool": "htmlhint",
        "source": { "tool": "htmlhint", "integration": "code" }
      },
      "native": {
        "htmlhint": {
          "passed": false,
          "error_count": 0,
          "warning_count": 1,
          "source": { "tool": "htmlhint", "integration": "code" }
        }
      }
    },
    "css": {
      "file_count": 8,
      "source": { "tool": "html", "integration": "code" },
      "lint": {
        "warnings": [
          {
            "file": "styles/main.css",
            "line": 42,
            "severity": "error",
            "message": "Unexpected unknown property \"colr\"",
            "rule": "property-no-unknown"
          }
        ],
        "tool": "stylelint",
        "source": { "tool": "stylelint", "integration": "code" }
      },
      "native": {
        "stylelint": {
          "passed": false,
          "error_count": 1,
          "warning_count": 0,
          "source": { "tool": "stylelint", "integration": "code" }
        }
      }
    },
    "scss": {
      "file_count": 3,
      "source": { "tool": "html", "integration": "code" }
    },
    "less": {
      "file_count": 2,
      "source": { "tool": "html", "integration": "code" }
    }
  }
}

Documentation

View on GitHub

HTML Collector

Detects and lints HTML, CSS, SCSS, and LESS files.

Overview

Scans repositories for HTML and CSS-family files, runs HTMLHint and Stylelint for code quality analysis. Writes file counts per type and lint results so policies can enforce markup quality standards. Runs in a custom html-main image with Node.js, HTMLHint, and Stylelint pre-installed.

Collected Data

This collector writes to the following Component JSON paths:

Path Type Description
.lang.html object Present only if .html files found
.lang.html.file_count number Number of .html files in the repository
.lang.html.lint object Normalized HTMLHint lint warnings
.lang.html.native.htmlhint object Raw HTMLHint output and status
.lang.css object Present only if .css files found
.lang.css.file_count number Number of .css files
.lang.css.lint object Normalized Stylelint lint warnings (covers CSS/SCSS/LESS)
.lang.css.native.stylelint object Raw Stylelint output and status
.lang.scss object Present only if .scss files found
.lang.scss.file_count number Number of .scss files
.lang.less object Present only if .less files found
.lang.less.file_count number Number of .less files

Collectors

This integration provides the following collectors (use include to select a subset):

Collector Hook Type Description
project code Detects HTML/CSS/SCSS/LESS files, writes counts to .lang.html, .lang.css, .lang.scss, .lang.less
htmlhint code Runs HTMLHint on .html files, writes lint results to .lang.html.lint
stylelint code Runs Stylelint on CSS/SCSS/LESS files, writes lint results to .lang.css.lint

Installation

Add to your lunar-config.yml:

collectors:
  - uses: github://earthly/lunar-lib/collectors/html@v1.0.0
    on: ["domain:your-domain"]
    # include: [project, htmlhint]  # Only include specific subcollectors

Open Source

This collector is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.

View Repository

Ready to Automate Your Standards?

See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 100+ built-in guardrails.

Works with any process
check AI agent rules & prompt files
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Automate Now
Paste your AGENTS.md or manual process doc and get guardrails in minutes
Book a Demo