skillfed

htmlhint

htmlhint enforces HTML structure and attribute correctness on static files and built output in .NET repositories. Target rendered HTML in folders like wwwroot/ or dist/ rather than raw server-side templates, keeping validation separate from JavaScript and full-site audits.

htmlhint validates static HTML files and generated frontend output in .NET web projects for structural correctness.

AI-generated summary based on this skill's SKILL.md

463 35 MIT updated by managedcode

Install

managedcode/dotnet-skills/htmlhint · repository language: C#

git clone https://github.com/managedcode/dotnet-skills
cp -r dotnet-skills/catalog/Tools/HTMLHint/skills/htmlhint ~/.claude/skills/htmlhint
npx skillfed install managedcode/dotnet-skills/htmlhint

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is htmlhint static html linting and how does it work?

htmlhint is an MIT-licensed linter that enforces HTML structure and attribute correctness on static files and built output in .NET repositories. It validates rendered HTML in folders like wwwroot/ or dist/ rather than raw server-side templates, keeping validation separate from JavaScript and full-site audits. htmlhint scans for syntax errors, malformed tags, and rule violations you configure.

How do I set up htmlhint to validate static HTML files in .NET web projects?

htmlhint can be installed via npm and configured to target your .NET project's output directories. After npm install, create a .htmlhintrc configuration file in your project root, then point htmlhint at your wwwroot/ or dist/ folder. You can integrate it into your build pipeline or run it manually before deployment to catch HTML quality issues early.

Can I lint generated HTML output before deployment or build completion?

Yes. htmlhint is designed to validate rendered HTML output, making it ideal for linting generated files before deployment. You can integrate it into your CI/CD pipeline or npm build scripts to run as a quality gate. This ensures HTML structure and attributes meet your standards before the application reaches production.

How do I configure HTML structure and attribute validation rules in htmlhint?

htmlhint rules and config are managed through a .htmlhintrc file where you enable or disable specific validators. You can customize checks for tag nesting, required attributes, deprecated elements, and more. The configuration file supports both JSON and JavaScript formats, letting you tailor validation to your project's HTML standards.

How do I integrate HTML quality checks into CI/CD or npm build scripts?

Add htmlhint to your package.json scripts section with a command like "lint:html": "htmlhint dist/". Then call this script in your CI/CD pipeline (GitHub Actions, Azure Pipelines, etc.) or as part of your npm build chain. htmlhint will report violations and can fail the build if errors exceed your threshold, enforcing a static HTML quality gate.

What should I do if htmlhint reports parser errors on templated or server-side HTML?

htmlhint works best on rendered, static HTML output rather than raw server-side templates (Razor, etc.). If you encounter parser errors, ensure you're linting the built output in wwwroot/ or dist/ after your build completes. For templated HTML, run htmlhint after rendering to HTML, not on the template source files themselves.

SKILL.md

rendered from the published skill — quoted content, verbatim

HTMLHint for Static HTML in .NET Repositories

Trigger On

  • the repo has static HTML files, generated frontend output, or standalone templates under wwwroot/, dist/, or other web folders
  • the user asks for HTML structure checks, invalid attribute detection, or basic DOM-quality linting
  • the repo wants a narrow HTML gate separate from JS, CSS, and full-site runtime audits

Do Not Use For

  • raw .cshtml or .razor source with server-side directives; lint the rendered or published

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 2 files
catalog/Tools/HTMLHint/skills/htmlhint/SKILL.md
catalog/Tools/HTMLHint/skills/htmlhint/manifest.json

Related skills

Tags

static-html-validation dom-quality-gate template-output-linting html-correctness-checker build-artifact-auditing markup-policy-enforcement frontend-asset-validation rendered-output-inspection web-folder-scanning