1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
# grunt-bootlint
> A Grunt wrapper for [Bootlint](https://www.npmjs.org/package/bootlint), the HTML linter for [Bootstrap](http://getbootstrap.com) projects
[![NPM version](https://badge.fury.io/js/grunt-bootlint.svg)](http://badge.fury.io/js/grunt-bootlint)
[![Build Status](https://travis-ci.org/zacechola/grunt-bootlint.svg?branch=master)](https://travis-ci.org/zacechola/grunt-bootlint)
[![Dependency Status](https://david-dm.org/zacechola/grunt-bootlint.svg)](https://david-dm.org/zacechola/grunt-bootlint)
[![devDependency Status](https://david-dm.org/zacechola/grunt-bootlint/dev-status.svg)](https://david-dm.org/zacechola/grunt-bootlint#info=devDependencies)
[![NPM](https://nodei.co/npm/grunt-bootlint.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/grunt-bootlint/)
## Getting Started
This plugin requires Grunt `~0.4.5`
If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
```shell
npm install grunt-bootlint --save-dev
```
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
```js
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()`.
```js
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.
```js
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](https://github.com/twbs/bootlint/wiki) (`String`s) to explicitly ignore.
Example:
```javascript
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](http://gruntjs.com/).
## Release History
- 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.
|