gulp-html5-lint
raw JSON → 1.1.0 verified Fri May 01 auth: no javascript maintenance
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.
Common errors
error Error: listen EADDRINUSE :::80 ↓
cause Defaults to port 80 for local server; conflicts with existing services.
fix
Specify a different port via options.port.
error Error: connect ECONNREFUSED 64.34.119.12:80 ↓
cause Cannot reach validator.nu API due to network issues.
fix
Check internet connection or firewall rules.
error TypeError: gulp.task is not a function ↓
cause 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.
Warnings
breaking Requires internet access: the plugin sends HTML files to validator.nu for validation. ↓
fix Ensure network connectivity or use a local validator instance.
deprecated gulp 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.
gotcha API timeout defaults to 10 seconds; large files may cause timeout increases. ↓
fix Increase timeout via options.apiCheck.timeout.
deprecated html5-lint package is no longer actively maintained, may break with API changes. ↓
fix Consider alternatives like gulp-htmlhint or gulp-w3c-html-validator.
breaking Only 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+.
Install
npm install gulp-html5-lint yarn add gulp-html5-lint pnpm add gulp-html5-lint Imports
- default wrong
import html5Lint from 'gulp-html5-lint';correctconst html5Lint = require('gulp-html5-lint'); - gulp wrong
gulp.task('lint', () => gulp.src('*.html').pipe(html5Lint()));correctgulp.task('lint', function() { return gulp.src('*.html').pipe(html5Lint()); }); - options wrong
html5Lint({ timeout: 5000 })correcthtml5Lint({ apiCheck: { timeout: 5000 } })
Quickstart
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']);