New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chai-htmlhint

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-htmlhint

Matcher for chai to validate that HTML is valid using HTMLHint

1.0.0
latest
Source
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

What is chai-htmlhint

chai-htmlhint is a wrapper of htmlhint to use with chai.

How to use it

You just have to pass the html you want to validate like this:

var myhtml = '<h1>my html</h1>';
expect(myhtml).to.be.validHtml;

The default rules are:

{
	"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

Keywords

chai

FAQs

Package last updated on 15 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts