# htmlint

> HTML(l)int - Lints HTML templates

Latest version **0.0.7** (published 2019-08-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install htmlint
pnpm add htmlint
yarn add htmlint
bun add htmlint
```

Provides the command `htmlint`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2019-08-28 |
| First published | 2018-05-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.0 |
| Dependencies | 2 |
| Unpacked size | 107.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Falko Schmidt |
| Maintainers | fschmidt |

## Links

- npm: https://www.npmjs.com/package/htmlint
- Repository: https://github.com/panter/htmlint
- Homepage: https://github.com/panter/htmlint#readme
- Issues: https://github.com/panter/htmlint/issues
- npm.io page: https://npm.io/package/htmlint

## Dependencies (2)

- [commander](https://npm.io/package/commander.md) ^2.15.1
- [parse5-sax-parser](https://npm.io/package/parse5-sax-parser.md) 5.0.0

## Recent versions

- 0.0.7 (latest) — 2019-08-28
- 0.0.6 — 2019-05-15
- 0.0.5 — 2019-05-15
- 0.0.4 — 2018-05-31
- 0.0.3 — 2018-05-29
- 0.0.2 — 2018-05-29
- 0.0.1 — 2018-05-29

## README

[![Build Status](https://travis-ci.org/panter/htmlint.svg?branch=master)](https://travis-ci.org/panter/htmlint)

# htmlint
Lints HTML snippets.

![linting example](demo.gif?raw=true)

## Features
- Detects inconsistent tag structure.

## Installation

```shell
npm install htmlinter
```

## Usage

### From the command line
```shell
node node_modules/htmlint path/to/some.html
```

### From a script

#### Lint strings
```js
const htmlint = require('./htmlint');
htmlint.checkString('<a></b>').then((issues) => {
  issues.forEach((issue) => {
    console.log(issue.print());
  });
});

// Output:
// Closing tag mismatch for <b> detected at line 1, column 4
// Unclosed element for <a> detected at line 1, column 1
```

#### Lint files
```js
const htmlint = require('./htmlint');
htmlint.checkString('path/to/some.html').then((issues) => {
  issues.forEach((issue) => {
    console.log(issue.print());
  });
});
```

## VIM integration

See [ALE fork](https://github.com/kaethorn/ale).

## Planned Features
- Autoformat according to formatting rules.

---
_Source: https://npm.io/package/htmlint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
