gulp-bootlint
A gulp wrapper for Bootlint, the HTML linter for Bootstrap projects.
First steps
If you are familiar with gulp just install the plugin from npm with the following command:
npm install gulp-bootlint --save-dev
Otherwise check out the Getting Started guide of gulp first.
Create a new gulp task
After installing the plugin you can create a new gulp task in your gulpfile.js
like this:
var gulp = require('gulp');
var bootlint = require('gulp-bootlint');
gulp.task('bootlint', function() {
return gulp.src('./index.html')
.pipe(bootlint());
});
Options
You can pass the following options as a single object when calling the bootlint plugin.
options.stoponerror
- Type:
Boolean
- Default:
false
Stops the gulp task if there are errors in the linted file.
options.stoponwarning
- Type:
Boolean
- Default:
false
Stops the gulp task if there are warnings in the linted file.
options.loglevel
- Type:
String
- Default:
error
- Options:
emergency
, alert
, critical
, error
, warning
, notice
, info
, debug
Defines which log messages should be printed to stdout
.
options.disabledIds
Array of bootlint problem ID codes (as Strings
) to explicitly ignore.
Example of options usage:
var gulp = require('gulp');
var bootlint = require('gulp-bootlint');
gulp.task('bootlint', function() {
return gulp.src('./index.html')
.pipe(bootlint({
stoponerror: true,
stoponwarning: true,
loglevel: debug,
disabledIds: ['W009', 'E007']
}));
});
Release History
- 2015-07-28 - v0.6.4: Bumped dependency versions
- 2015-06-21 - v0.6.0: Added option to define log level
- 2015-06-18 - v0.5.1: Bumped dependency versions
- 2015-04-28 - v0.5.0: Added parameters to stop task on error or warning
- 2015-04-25 - v0.4.0: Updated Bootlint to v0.12.0 / Bumped other dependency versions
- 2015-02-24 - v0.3.0: Updated Bootlint to v0.11.0 / Bumped other dependency versions
- 2015-01-26 - v0.2.3: Updated Bootlint to v0.10.0
- 2015-01-07 - v0.2.2: Updated dependencies
- 2015-01-01 - v0.2.1: Code cleanup
- 2015-01-01 - v0.2.0: Updated Bootlint to v0.9.1
- 2015-01-01 - v0.1.1: Fail on linting errors
- 2014-11-23 - v0.1.0: First public release
License
Copyright (c) 2015 Jürg Hunziker. Licensed under the MIT License.