JSPM

gulp-html-validate

0.2.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 183
  • Score
    100M100P100Q76438F
  • License MIT

Validate files with `html-validate`

Package Exports

  • gulp-html-validate

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-html-validate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-html-validate

Validate files with html-validate validator.

Installation

> npm install --save-dev gulp-html-validate

Usage

const gulp = require('gulp');
const htmlvalidate = require('gulp-html-validate');

exports.default = () => {
    return (
        gulp
            .src('index.html')
            /*
             * Aaply the `html-validate` report to each file object, so these
             * reports can be used by other modules.
             */
            .pipe(htmlvalidate())
            /*
             * Output `html-validate` results to the console.
             */
            .pipe(htmlvalidate.format())
            /*
             * Make gulp to exit with an error code if any error(s) occurred.
             */
            .pipe(htmlvalidate.failAfterError())
    );
};

API

htmlvalidate()

Apply html-validate report to each file.

format(formatter)

Print a report where all errors/warnings are listed. This function should be used in the stream after piping through htmlvalidate function; otherwise, it will find no html-validate results to format.

The formatter parameter is a string, which defined the formatter name to use.

Any formatter supported by html-validate can be used. The stylish formatter is used by default.

failAfterError()

Throw an error if html-validate found an error in any file. All files will be processed before throwing an error.

License

Licensed under the MIT License.