Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/htmlhint/chai-htmlhint
Extends Chai with assertions for HTMLHint
https://github.com/htmlhint/chai-htmlhint
chai hint htmlhint
Last synced: about 1 month ago
JSON representation
Extends Chai with assertions for HTMLHint
- Host: GitHub
- URL: https://github.com/htmlhint/chai-htmlhint
- Owner: htmlhint
- License: mit
- Created: 2016-04-15T23:31:18.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-09-10T00:33:59.000Z (over 6 years ago)
- Last Synced: 2024-11-19T17:56:15.880Z (2 months ago)
- Topics: chai, hint, htmlhint
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Contributing: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Chai HTMLHint
Extends Chai with assertions for HTMLHint
How To Use • Contributing • Roadmap • Website# Usage
You just have to pass the html you want to validate like this:
```javascript
var myhtml = 'my html
';
expect(myhtml).to.be.validHtml;
```The default rules are:
```json
{
"alt-require": true,
"attr-lowercase": true,
"attr-no-duplication": true,
"attr-unsafe-chars": true,
"attr-value-double-quotes": true,
"doctype-first": true,
"doctype-html5": true,
"id-unique": true,
"inline-script-disabled": false,
"inline-style-disabled": false,
"space-tab-mixed-disabled": true,
"spec-char-escape": true,
"src-not-empty": true,
"style-disabled": true,
"tag-pair": true,
"tag-self-close": true,
"tagname-lowercase": true,
"title-require": true
};
```If you want to override you just need a valid `.htmlhintrc` file in the root of your project
## LICENCE
Project initially created by [@molant](https://github.com/molant) and transferred to the [HTMLHint](https://github.com/htmlhint) organization.
[MIT License](./LICENSE)