gulp-bootlint
Advanced tools
Comparing version 0.7.2 to 0.8.0
12
index.js
@@ -82,2 +82,3 @@ /* | ||
disabledIds: [], | ||
issues: [], | ||
reportFn: defaultReportFn, | ||
@@ -128,8 +129,6 @@ summaryReportFn: defaultSummaryReportFn | ||
} | ||
file.bootlint.success = false; | ||
file.bootlint.issues.push(lint); | ||
options.issues.push(lint); | ||
}; | ||
log.info(gutil.colors.gray('Linting file ' + file.path)); | ||
file.bootlint = { success: true, issues: [] }; | ||
bootlint.lintHtml(file.contents.toString(), reporter, options.disabledIds); | ||
@@ -143,5 +142,8 @@ | ||
}, function (cb) { | ||
if ((hasError && options.stoponerror) || (hasWarning && options.stoponwarning)) { | ||
if (hasError && options.stoponerror ) { | ||
this.emit('error', new PluginError(PLUGIN_NAME, 'Lint errors found!')); | ||
} | ||
if (hasWarning && options.stoponwarning) { | ||
this.emit('warning', new PluginError(PLUGIN_NAME, 'Lint warnings found!')); | ||
} | ||
@@ -155,2 +157,2 @@ return cb(); | ||
// exporting the plugin | ||
module.exports = gulpBootlint; | ||
module.exports = gulpBootlint; |
{ | ||
"name": "gulp-bootlint", | ||
"version": "0.7.2", | ||
"version": "0.8.0", | ||
"description": "A gulp wrapper for Bootlint, the HTML linter for Bootstrap projects", | ||
@@ -46,5 +46,5 @@ "license": "MIT", | ||
"devDependencies": { | ||
"jshint": "^2.9.1", | ||
"mocha": "^2.4.5", | ||
"should": "^8.3.0" | ||
"jshint": "^2.9.2", | ||
"mocha": "^2.5.1", | ||
"should": "^8.4.0" | ||
}, | ||
@@ -51,0 +51,0 @@ "readmeFilename": "README.md", |
# gulp-bootlint | ||
[![npm version](https://badge.fury.io/js/gulp-bootlint.svg)](http://badge.fury.io/js/gulp-bootlint) [![Build Status](https://travis-ci.org/tschortsch/gulp-bootlint.svg?branch=master)](https://travis-ci.org/tschortsch/gulp-bootlint) [![Dependency Status](https://david-dm.org/tschortsch/gulp-bootlint.svg)](https://david-dm.org/tschortsch/gulp-bootlint) [![devDependency Status](https://david-dm.org/tschortsch/gulp-bootlint/dev-status.svg)](https://david-dm.org/tschortsch/gulp-bootlint#info=devDependencies) | ||
[![npm version](https://badge.fury.io/js/gulp-bootlint.svg)](https://badge.fury.io/js/gulp-bootlint) [![Build Status](https://travis-ci.org/tschortsch/gulp-bootlint.svg?branch=master)](https://travis-ci.org/tschortsch/gulp-bootlint) [![Dependency Status](https://david-dm.org/tschortsch/gulp-bootlint.svg)](https://david-dm.org/tschortsch/gulp-bootlint) [![devDependency Status](https://david-dm.org/tschortsch/gulp-bootlint/dev-status.svg)](https://david-dm.org/tschortsch/gulp-bootlint#info=devDependencies) | ||
@@ -63,2 +63,12 @@ A gulp wrapper for [Bootlint](https://github.com/twbs/bootlint), the HTML linter for Bootstrap projects. | ||
### options.issues | ||
* Type: `Array` of `LintWarning` and `LintError` objects | ||
* Default: `[]` | ||
All found issues (Objects of type `LintWarning` and `LintError`) are stored in this array. | ||
You can access and use them after executing this module. | ||
The classes `LintWarning` and `LintError` are described here https://github.com/twbs/bootlint#api-documentation. | ||
### options.reportFn | ||
@@ -95,2 +105,3 @@ | ||
gulp.task('bootlint', function() { | ||
var fileIssues = []; | ||
return gulp.src('./index.html') | ||
@@ -102,2 +113,3 @@ .pipe(bootlint({ | ||
disabledIds: ['W009', 'E007'], | ||
issues: fileIssues, | ||
reportFn: function(file, lint, isError, isWarning, errorLocation) { | ||
@@ -125,2 +137,3 @@ var message = (isError) ? "ERROR! - " : "WARN! - "; | ||
* 2016-05-24 - v0.8.0: Possibility to provide array where found issues are stored | ||
* 2016-04-12 - v0.7.2: Bumped dependency versions | ||
@@ -144,2 +157,2 @@ * 2015-11-25 - v0.7.1: Updated Bootlint to v0.14.2 | ||
Copyright (c) 2016 Jürg Hunziker. Licensed under the MIT License. | ||
Copyright (c) 2016 Jürg Hunziker. Licensed under the MIT License. |
12930
133
154