Commit 38358dfe authored by David Sveningsson's avatar David Sveningsson

archive

parent f789df7e
Pipeline #2389 passed with stages
in 3 minutes and 38 seconds
# html-validate
[![pipeline status](https://git.sidvind.com/html-validate/html-validate/badges/master/pipeline.svg)](https://git.sidvind.com/html-validate/html-validate/commits/master)
[![coverage report](https://git.sidvind.com/html-validate/html-validate/badges/master/coverage.svg)](https://git.sidvind.com/html-validate/html-validate/commits/master)
Offline HTML5 validator. Validates either a full document or a smaller
(incomplete) template, e.g. from an AngularJS or React component.
## 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 FILENAME..
## Configuration
Create `.htmlvalidate.json`:
```js
{
"extends": [
"htmlvalidate:recommended"
],
"rules": {
"close-order": "error"
"void": ["warn", {"style": "omit"}]
}
}
```
## Example
```html
<p>
<button>Click me!</button>
<div id="show-me">
Lorem ipsum
</div>
</p>
```
```text
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
```
## Test
Testing is done using jest.
npm test
or call `jest` directly.
Some tests are autogenerated from documentation examples, use `grunt docs` to
build those before running.
## Lint
Linting is done using eslint.
npm run lint
or call `eslint` directly.
## Build
grunt build
grunt docs
THIS PROJECT HAS BEEN MIGRATED TO https://gitlab.com/html-validate/html-validate
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment