GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - html-validate/html-validate: Mirror of the HTML-Validate GitLab repository

BranchesTags
Open more actions menu

Latest commit

 

History

8,845 Commits
8,845 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.gitlab
.gitlab
 
 
.husky
.husky
 
 
bin
bin
 
 
docs
docs
 
 
entrypoints
entrypoints
 
 
etc
etc
 
 
internal
internal
 
 
sandbox
sandbox
 
 
scripts
scripts
 
 
src
src
 
 
test-files
test-files
 
 
testbeds/jest
testbeds/jest
 
 
tests
tests
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
.markdownlint-cli2.jsonc
.markdownlint-cli2.jsonc
 
 
.npmignore
.npmignore
 
 
.npmrc
.npmrc
 
 
.prettierignore
.prettierignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
MIGRATION.md
MIGRATION.md
 
 
README.md
README.md
 
 
api-extractor.json
api-extractor.json
 
 
build.mjs
build.mjs
 
 
eslint.config.mjs
eslint.config.mjs
 
 
jest.global.cjs
jest.global.cjs
 
 
jest.setup.cjs
jest.setup.cjs
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
renovate.json
renovate.json
 
 
rollup.config.mjs
rollup.config.mjs
 
 
tsconfig.json
tsconfig.json
 
 
tsdoc.json
tsdoc.json
 
 
vitest.config.mts
vitest.config.mts
 
 
vitest.global.mts
vitest.global.mts
 
 
vitest.setup.mts
vitest.setup.mts
 
 

Repository files navigation

html-validate

pipeline status coverage report

Offline HTML5 validator. Validates either a full document or a smaller (incomplete) template, e.g. from an AngularJS or Vue.js component.

Read the full documentation at https://html-validate.org/

Features

  • Can test fragments of HTML, for instance a component template.
  • Does not upload any data to a remote server, all testing is done locally.
  • Strict and non-forgiving parsing. It will not try to correct any incorrect markup or guess what it should do.

Usage

npm install -g html-validate
html-validate [OPTIONS] [FILENAME..] [DIR..]

Configuration

Create .htmlvalidate.json:

{
  "extends": ["html-validate:recommended"],

  "rules": {
    "close-order": "error",
    "void": ["warn", { "style": "omit" }]
  }
}

Example

<p>
  <button>Click me!</button>
  <div id="show-me">
    Lorem ipsum
  </div>
</p>
  1:1  error  Element <p> is implicitly closed by adjacent <div>  no-implicit-close
  2:2  error  Button is missing type attribute                    button-type
  6:4  error  Unexpected close-tag, expected opening tag          close-order

Bundles

The library comes in four flavours:

  • CommonJS full (dist/cjs/index.js)
  • CommonJS browser (dist/cjs/browser.js)
  • ESM full (dist/esm/index.js)
  • ESM browser (dist/esm/browser.js)

The browser bundle contains a slimmed version without CLI and NodeJS dependencies.

/* automatically determine build based on `browser` export condition */
import { ... } from "html-validate";

/* explicitly use nodejs bundle */
import { ... } from "html-validate/node";

/* explicitly use browser bundle */
import { ... } from "html-validate/browser";

See running in browser for details about getting HTML-Validate running in a browser environment.

Developing

Prerequisites

  • Node.js 22.16, 24.0 or later.
  • NPM 10

Test

Testing is done using jest.

npm test

or call jest directly.

Some tests are autogenerated from documentation examples, use npm run docs to build those before running.

Lint

Linting is done using ESLint.

npm run eslint

or call eslint directly.

Build

npm run build

To build documentation use:

npm run docs

The documentation can be served locally using:

npm start

About

Mirror of the HTML-Validate GitLab repository

html-validate.org

Topics

devtoolshacktoberfesthtmlhtml-checkerhtml-linterhtml-validatehtml-validationweb-developmentweb-standards

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

19 stars

Watchers

2 watching

Forks

2 forks
Report repository

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.