tteltrab / grunt-bootlint

A Grunt wrapper for Bootlint, the HTML linter for Bootstrap projects

Home Page: https://www.npmjs.org/package/grunt-bootlint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

grunt-bootlint

A Grunt wrapper for Bootlint, the HTML linter for Bootstrap projects

NPM version Build Status Dependency Status devDependency Status

NPM

Getting Started

This plugin requires Grunt ~0.4.5

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-bootlint --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-bootlint');

The "bootlint" task

Overview

In your project's Gruntfile, add a section named bootlint to the data object passed into grunt.initConfig().

grunt.initConfig({
  bootlint: {
    options: {
      stoponerror: false,
      relaxerror: []
    },
    files: ['path/to/file.html', 'path/to/*.html'],
  },
});

Options

Usage Examples

Default Options

In this example, the default options are used to lint two files for common errors in bootstrap.

grunt.initConfig({
  bootlint: {
    options: {
      stoponerror: false,
      relaxerror: []
    },
    files: ['test/fixtures/**.html'],
  },
});

Settings

options.stoponerror

  • Type: Boolean
  • Default: false

Breaks out of grunt task on first error. Use --force to force continue.

options.relaxerror

  • Type: Array
  • Default: []

Array of bootlint problem ID codes (Strings) to explicitly ignore.

Example:

grunt.initConfig({
  bootlint: {
    options: {
      relaxerror: ['W001', 'E001']
    },
    files: ['test/fixtures/**.html'],
  },
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 2014-11-10 - v0.5.1: Displays message when files pass
  • 2014-11-10 - v0.5.0: Updates Bootlint, adds line/col numbers to output, quieter output.
  • 2014-11-03 - v0.4.0: Updates Bootlint dependency.
  • 2014-10-17 - v0.3.0: Basic support for Bootlint 0.5.0. Changes relaxerror to use Bootlint problem IDs
  • 2014-09-25 - v0.2.1: Removes color dependency.
  • 2014-09-25 - v0.2.0: First formal release.

About

A Grunt wrapper for Bootlint, the HTML linter for Bootstrap projects

https://www.npmjs.org/package/grunt-bootlint

License:MIT License