All Projects → validator → Grunt Html

validator / Grunt Html

Licence: mit
Grunt plugin for html validation

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Grunt Html

ngx-translate-lint
Simple CLI tools for check `ngx-translate` keys
Stars: ✭ 25 (-84.85%)
Mutual labels:  lint, checker, validator
lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-91.52%)
Mutual labels:  lint, checker
garn-validator
Create validations with ease
Stars: ✭ 42 (-74.55%)
Mutual labels:  checker, validator
codeowners-validator
The GitHub CODEOWNERS file validator
Stars: ✭ 142 (-13.94%)
Mutual labels:  checker, validator
Grunt Recess
[DEPRECATED] Lint and minify CSS and LESS
Stars: ✭ 205 (+24.24%)
Mutual labels:  grunt, lint
denetmen
useful micro check library for Crystal Language.
Stars: ✭ 23 (-86.06%)
Mutual labels:  checker, validator
A11yc
Check accessibility of target page and generate accessibility evaluate page and policy.
Stars: ✭ 13 (-92.12%)
Mutual labels:  validator, checker
python-valid8
Yet another validation lib ;). Provides tools for general-purpose variable validation, function inputs/outputs validation as well as class fields validation. All entry points raise consistent ValidationError including all contextual details, with dynamic inheritance of ValueError/TypeError as appropriate.
Stars: ✭ 24 (-85.45%)
Mutual labels:  checker, validator
dockerfile-utils
A library and command line interface for formatting and linting Dockerfiles.
Stars: ✭ 17 (-89.7%)
Mutual labels:  lint, validator
openapi-lint-vscode
OpenAPI 2.0/3.0.x intellisense, validator, linter, converter and resolver extension for Visual Studio Code
Stars: ✭ 47 (-71.52%)
Mutual labels:  lint, validator
jsonlint
Lightweight command-line tool for validating JSON
Stars: ✭ 27 (-83.64%)
Mutual labels:  checker, validator
Httpolice
Validator for HTTP
Stars: ✭ 948 (+474.55%)
Mutual labels:  lint, validator
Credit Card
Credit Card Validation
Stars: ✭ 150 (-9.09%)
Mutual labels:  validator
Validation Composite
Allows uniting of several validation rules into single one for easy re-usage
Stars: ✭ 159 (-3.64%)
Mutual labels:  validator
Pettier
Prettier config that randomizes options and arbitrarily switches between spaces and tabs 🙄
Stars: ✭ 149 (-9.7%)
Mutual labels:  lint
Ajv Cli
Use 'Another Json Validator' (ajv) from the command line
Stars: ✭ 148 (-10.3%)
Mutual labels:  validator
Schema Utils
Options Validation
Stars: ✭ 162 (-1.82%)
Mutual labels:  validator
Cflint
Static code analysis for CFML (a linter)
Stars: ✭ 156 (-5.45%)
Mutual labels:  lint
Servermonitor
💓 Laravel package to periodically monitor the health of your server and application.
Stars: ✭ 148 (-10.3%)
Mutual labels:  checker
Glslang
Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.
Stars: ✭ 2,034 (+1132.73%)
Mutual labels:  validator

grunt-html

NPM version Total alerts Build Status Coverage Status dependencies Status devDependencies Status

Grunt plugin for HTML validation, using the Nu Html Checker (v.Nu).

Getting Started

Install this grunt plugin next to your project's Gruntfile.js with:

npm install grunt-html --save-dev

Then add this line to your project's Gruntfile.js:

grunt.loadNpmTasks('grunt-html');

Then specify what files to validate in your config:

grunt.initConfig({
  htmllint: {
    all: ['demos/**/*.html', 'tests/**/*.html']
  }
});

For fast validation, keep that in a single group, as the validator initialization takes a few seconds.

When combined with a watching task (such as grunt-contrib-watch), even faster validation can be achieved by starting the validator in client mode and connecting to an already-running instance of the validator in server mode. This removes the time required by repeated initializations. See the server option below.

Options

ignore

  • Type: Array, String, or RegExp
  • Default: null

Use this to specify the error message(s) to ignore. For example:

all: {
  options: {
    ignore: 'The “clear” attribute on the “br” element is obsolete. Use CSS instead.'
  },
  src: 'html4.html'
}

The ignore option also supports regular expressions. For example, to ignore AngularJS directive attributes:

all: {
  options: {
    ignore: /attribute “ng-[a-z-]+” not allowed/
  },
  src: 'app.html'
}

server

  • Type: Object, or a falsy value
  • Default: false

When server is set to a falsy value, the validator is invoked using java -jar, which can be considered normal operation.

Set server to an object to start the validator in client mode and connect to an already-running instance of the validator in server mode. To start the validator in server mode, use java -cp "path/to/vnu.jar" nu.validator.servlet.Main <port>.

all: {
  options: {
    // connect to a validator instance running in server mode on localhost:8888
    server: {}
  },
  src: 'app.html'
}

The server object also accepts the host and port keys, specifying the location of the server.

all: {
  options: {
    server: {
      // your team's local dev tool machine, for example
      host: '192.168.0.5',
      port: 8877
    }
  },
  src: 'app.html'
}

The following configuration in Gruntfile.js uses grunt-vnuserver to start the validator in server mode and sets up a watch task to run htmllint every time the source file changes. By starting the validator in server mode once using the vnuserver task, validations by htmllint can be performed much faster by simply connecting to this already-running server.

module.exports = function (grunt) {
  grunt.initConfig({
    vnuserver: {
    },
    htmllint: {
      all: {
        options: {
          server: {}
        },
        src: 'app.html'
      }
    },
    watch: {
      all: {
        tasks: ['htmllint'],
        files: 'app.html'
      }
    }
  });

  grunt.loadNpmTasks('grunt-vnuserver');
  grunt.loadNpmTasks('grunt-html');
  grunt.loadNpmTasks('grunt-contrib-watch');

  grunt.registerTask('default', ['vnuserver', 'watch']);
};

errorlevels

  • Type: Array
  • Default: 'info','warning','error'

Set errorlevels to control which error types are returned from the validator. Ignores all other returned types.

force

  • Type: Boolean
  • Default: false

Set force to true to report errors but not fail the grunt task.

reporter

  • Type: String
  • Default: null

Allows you to modify the output format. By default, this plugin will use a built-in Grunt reporter. Set the path to your own custom reporter or to one of the provided reporters: checkstyle, junit or json.

reporterOutput

  • Type: String
  • Default: null

Specify a filepath to output the results of a reporter. If reporterOutput is specified then all output will be written to the given filepath rather than printed to stdout.

absoluteFilePathsForReporter

  • Type: Boolean
  • Default: false

Set absoluteFilePathsForReporter to true to use absolute file paths in generated reports.

noLangDetect

  • Type: Boolean
  • Default: false

Set noLangDetect to true to skip the checking of the language of the page.

Potential pitfalls

  • vnu.jar requires Java 8 environment or up.

License

Copyright Jörn Zaefferer.
Licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].