All Projects → tschortsch → Gulp Bootlint

tschortsch / Gulp Bootlint

Licence: mit
A gulp wrapper for Bootlint, the HTML linter for Bootstrap projects.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gulp Bootlint

Ignition Go
Bootstrap4 /Codeigniter 3 Modular (HMVC) App Building Framework - to build enterprise class web applications... Versions: CodeIgniter 3.1.9 AdminLTE 3.4 Bootstrap 4.5.0
Stars: ✭ 166 (+295.24%)
Mutual labels:  gulp, bootstrap
Angular bootstrap spring
AngularJS, Restful, Spring, Spring Security, Hibernate,Bootstrap, Gulp in ES6, Maven
Stars: ✭ 125 (+197.62%)
Mutual labels:  gulp, bootstrap
Frontie Webpack
Front-end Boilerplate | Gulp 4 + Webpack 4 + Babel + ITCSS Architecture + BEM Methodology + Twig.js
Stars: ✭ 102 (+142.86%)
Mutual labels:  gulp, bootstrap
Neumorphism Ui Bootstrap
Neumorphism inspired UI Kit: web components, sections and pages in neumorphic style built with Bootstrap CSS Framework
Stars: ✭ 463 (+1002.38%)
Mutual labels:  gulp, bootstrap
100 Days Of Code Frontend
Curriculum for learning front-end development during #100DaysOfCode.
Stars: ✭ 2,419 (+5659.52%)
Mutual labels:  gulp, bootstrap
Fe
前端热门文章阅读
Stars: ✭ 174 (+314.29%)
Mutual labels:  gulp, bootstrap
Bootstrap 4 Sass Gulp 4 Boilerplate
A Bootstrap 4.5.2 boilerplate with font-awesome, sass, gulp 4 tasks
Stars: ✭ 103 (+145.24%)
Mutual labels:  gulp, bootstrap
Stellar
Stellar is completely based on the latest version of Bootstrap 4. Stellar Admin is designed to reflect the simplicity and svelte of the components and UI elements and coded to perfection with well-organized code.
Stars: ✭ 176 (+319.05%)
Mutual labels:  gulp, bootstrap
Pixel Bootstrap Ui Kit
Pixel UI - Free and open source Bootstrap 5 UI Kit without jQuery
Stars: ✭ 406 (+866.67%)
Mutual labels:  gulp, bootstrap
Purpleadmin Free Admin Template
Purple Admin is one of the most stylish Bootstrap admin dashboard you can get hands on. With its beautifully crafted captivating design and well-structured code.
Stars: ✭ 473 (+1026.19%)
Mutual labels:  gulp, bootstrap
Redmine bootstrap kit
A Redmine plugin which makes developing your own Redmine plugin easy ;)
Stars: ✭ 36 (-14.29%)
Mutual labels:  bootstrap
Generator Fountain Webapp
Yeoman 'fountain' generator to start a webapp
Stars: ✭ 985 (+2245.24%)
Mutual labels:  gulp
Freelancers Market
Laravel Project to help freelance websites clients and freelancers to find each other.
Stars: ✭ 39 (-7.14%)
Mutual labels:  bootstrap
Bootstrap Navbar
Helpers to generate a Twitter Bootstrap navbar
Stars: ✭ 40 (-4.76%)
Mutual labels:  bootstrap
Webpack React
📦 A sample project to demonstrate bundling ES6, React, SASS and Bootstrap with Webpack
Stars: ✭ 36 (-14.29%)
Mutual labels:  bootstrap
Gramophone
WordPress, Bootstrap 4 & <3
Stars: ✭ 39 (-7.14%)
Mutual labels:  bootstrap
Qlcommonmark
QuickLook generator for beautifully rendering CommonMark documents on macOS
Stars: ✭ 36 (-14.29%)
Mutual labels:  bootstrap
Angular4 Admin Front
Admin system front based on Angular. 基于Angular4的后台管理系统(no longer maintain)
Stars: ✭ 36 (-14.29%)
Mutual labels:  bootstrap
Adminx
AdminX – a free and open source admin control panel based on Bootstrap 4.x
Stars: ✭ 36 (-14.29%)
Mutual labels:  bootstrap
Ng Bootstrap
Angular powered Bootstrap
Stars: ✭ 7,872 (+18642.86%)
Mutual labels:  bootstrap

gulp-bootlint

npm version Build Status dependencies Status devDependencies Status

A gulp wrapper for Bootlint, the HTML linter for Bootstrap projects.

Requirements

  • Node.js >= 8.x

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.disabledIds

  • Type: String[]
  • Default: []

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

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

  • Type: Function
  • Parameter:
    • Object file - File with linting error.
    • Object lint - Linting error.
    • Boolean isError - True if current linting problem is an error.
    • Boolean isWarning - True if current linting problem is a warning.
    • Object errorLocation - Error location in file.

A function that will log out the lint errors to the console. Only use this if you want to customize how the lint errors are reported. If desired, this can be turned off entirely by setting reportFn: false.

options.summaryReportFn

  • Type: Function
  • Parameter:
    • Object file - File which was linted.
    • Integer errorCount - Total count of errors in the file.
    • Integer warningCount - Total count of warnings in the file.

A function that will log out the final lint error/warning summary to the console. Only use this if you want to customize how this is reported. If desired, this can be turned off entirely by setting summaryReportFn: false.

Example of options usage:

var gulp = require('gulp');
var bootlint = require('gulp-bootlint');

gulp.task('bootlint', function () {
  var fileIssues = [];
  return gulp.src('./index.html')
    .pipe(bootlint({
      stoponerror: true,
      stoponwarning: true,
      disabledIds: ['W009', 'E007'],
      issues: fileIssues,
      reportFn: function (file, lint, isError, isWarning, errorLocation) {
        var message = (isError) ? 'ERROR! - ' : 'WARN! - ';
        if (errorLocation) {
          message += file.path + ' (line:' + (errorLocation.line + 1) + ', col:' + (errorLocation.column + 1) + ') [' + lint.id + '] ' + lint.message;
        } else {
          message += file.path + ': ' + lint.id + ' ' + lint.message;
        }
        console.log(message);
      },
      summaryReportFn: function(file, errorCount, warningCount) {
        if (errorCount > 0 || warningCount > 0) {
          console.log('please fix the ' + errorCount + ' errors and ' + warningCount + ' warnings in ' + file.path);
        } else {
          console.log('No problems found in ' + file.path);
        }
      },
    }));
});

Log level

To set the log level please use the LOG_LEVEL environment variable before starting your gulp task:

$ LOG_LEVEL=error npm run gulp

Available log levels are listed here: https://github.com/medikoo/log#available-log-levels

Changelog

  • 2019-12-12 - v1.0.0
    • Updated bootlint to v1.0.0
    • Updated log package to v6.0.0
    • Dropped loglevel option since it's not supported anymore by the new log package. To set the log level please use the LOG_LEVEL environment variable before running your gulp task (see: https://github.com/tschortsch/gulp-bootlint#log-level).
    • Bumped other dependency versions
  • 2019-06-26 - v0.11.0
    • Dropped support for Node.js versions <= 7
    • Updated Bootlint to v0.16.6
    • Bumped dependency versions
  • 2018-12-15 - v0.10.2: Bumped dependency versions
  • 2018-10-02 - v0.10.1: Updated bootlint to v0.15.1 / Bumped dependency versions
  • 2018-04-24 - v0.9.0: Replaced deprecated gulp-util (thanks to TheDancingCode)
  • 2017-02-01 - v0.8.1: Bumped dependency versions
  • 2016-05-24 - v0.8.0: Possibility to provide array where found issues are stored
  • 2016-04-12 - v0.7.2: Bumped dependency versions
  • 2015-11-25 - v0.7.1: Updated Bootlint to v0.14.2
  • 2015-11-16 - v0.7.0: Updated Bootlint to v0.14.1 / Added options to define reporters (thx @chrismbarr) / Bumped dependency versions
  • 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
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].