Skip to content

Commit b09bd82

Browse files
committed
Adding readme and fixing dependencies
1 parent bc18038 commit b09bd82

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
},
2525
"homepage": "https://github.com/molant/chai-htmlhint#readme",
2626
"dependencies": {
27-
"lodash": "^4.11.1",
28-
"request": "^2.71.0"
27+
"lodash": "^4.11.1"
2928
}
3029
}

readme.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# What is chai-htmlhint
2+
chai-htmlhint is a wrapper of [htmlhint](https://github.com/yaniswang/HTMLHint/) to use with chai.
3+
4+
# How to use it
5+
You just have to pass the html you want to validate like this:
6+
```javascript
7+
var myhtml = '<h1>my html</h1>';
8+
expect(myhtml).to.be.validHtml;
9+
```
10+
11+
The default rules are:
12+
```json
13+
{
14+
"alt-require": true,
15+
"attr-lowercase": true,
16+
"attr-no-duplication": true,
17+
"attr-unsafe-chars": true,
18+
"attr-value-double-quotes": true,
19+
"doctype-first": true,
20+
"doctype-html5": true,
21+
"id-unique": true,
22+
"inline-script-disabled": false,
23+
"inline-style-disabled": false,
24+
"space-tab-mixed-disabled": true,
25+
"spec-char-escape": true,
26+
"src-not-empty": true,
27+
"style-disabled": true,
28+
"tag-pair": true,
29+
"tag-self-close": true,
30+
"tagname-lowercase": true,
31+
"title-require": true
32+
};
33+
```
34+
35+
If you want to override you just need a valid `.htmlhintrc` file in the root of your project

0 commit comments

Comments
 (0)