Registry / testing / gulp-html5-lint

gulp-html5-lint

JSON →
library1.1.0jsnpmunverified

Gulp plugin for HTML5 linting using the Mozilla HTML5 validator API. Version 1.1.0 is the latest stable release. This plugin sends HTML files to the validator.nu API for validation and reports issues via gulp-notify. It is designed for use with gulp 3.x and wraps the html5-lint npm package. Key differentiators: leverages the official Mozilla validator API (requires internet connectivity), provides options for API timeout and error handling, and integrates seamlessly into gulp workflows. Alternatives: gulp-htmlhint, gulp-w3c-html-validator.

npm install gulp-html5-lint
INSTALL
IMPORT
SIG · GULP-HTML5-LINT
G
gulp-html5-lint
testingjavascriptv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const html5Lint = require('gulp-html5-lint');
import html5Lint from 'gulp-html5-lint';
CommonJS module; no default ES import supported. Use require() in gulpfile.
gulp
gulp.task('lint', function() { return gulp.src('*.html').pipe(html5Lint()); });
gulp.task('lint', () => gulp.src('*.html').pipe(html5Lint()));
Arrow functions may cause issues with 'this' in older gulp versions; use regular functions for gulp 3.x.
options
html5Lint({ apiCheck: { timeout: 5000 } })
html5Lint({ timeout: 5000 })
Timeout option must be nested under apiCheck object.

Sets up a gulp task that lints all HTML files in ./src using the Mozilla validator API.

const gulp = require('gulp'); const html5Lint = require('gulp-html5-lint'); gulp.task('html5-lint', function() { return gulp.src('./src/*.html') .pipe(html5Lint()); }); gulp.task('default', ['html5-lint']);
Debug
Known issues
breakingRequires internet access: the plugin sends HTML files to validator.nu for validation.
fix
Ensure network connectivity or use a local validator instance.
affects: >=0.0.0
deprecatedgulp 4.x compatibility not guaranteed: plugin uses gulp.src and gulp.task patterns from gulp 3.x.
fix
Use gulp 3.x or wrap with appropriate gulp 4 task syntax.
affects: >=1.0.0
gotchaAPI timeout defaults to 10 seconds; large files may cause timeout increases.
fix
Increase timeout via options.apiCheck.timeout.
affects: >=1.0.0
deprecatedhtml5-lint package is no longer actively maintained, may break with API changes.
fix
Consider alternatives like gulp-htmlhint or gulp-w3c-html-validator.
affects: >=1.0.0
breakingOnly supports Node.js 0.10+; not tested on newer Node versions.
fix
Use Node.js 0.10 to 10.x; may fail on Node 12+.
affects: >=1.0.0
Errors
Common errors & fixes
Error: listen EADDRINUSE :::80
Defaults to port 80 for local server; conflicts with existing services.
fix
Specify a different port via options.port.
Error: connect ECONNREFUSED 64.34.119.12:80
Cannot reach validator.nu API due to network issues.
fix
Check internet connection or firewall rules.
TypeError: gulp.task is not a function
Using ES6 import syntax or gulp 4 which requires gulp.task() to be called differently.
fix
Use require() and gulp 3.x syntax, or use gulp.series for gulp 4.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
html5-lintrequiredCore dependency providing HTML5 linting logic via validator.nu API
gulprequiredPeer dependency; plugin is a gulp plugin
Agent activity
4 hits · last 30 days
node
4
Resources
gulp-html5-lint — npm install gulp-html5-lint · libregistry