Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
gulp-bootlint
Advanced tools
Readme
A gulp wrapper for Bootlint, the HTML linter for Bootstrap projects.
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.
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());
});
You can pass the following options as a single object when calling the bootlint plugin.
Boolean
false
Stops the gulp task if there are errors in the linted file.
Boolean
false
Stops the gulp task if there are warnings in the linted file.
String
'error'
'emergency'
, 'alert'
, 'critical'
, 'error'
, 'warning'
, 'notice'
, 'info'
, 'debug'
Defines which log messages should be printed to stdout
.
String[]
[]
Array of bootlint problem ID codes (as Strings
) to explicitly ignore.
Array
of LintWarning
and LintError
objects[]
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.
Function
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
.
Function
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
.
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,
loglevel: 'debug',
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);
}
}
}));
});
FAQs
A gulp wrapper for Bootlint, the HTML linter for Bootstrap projects
The npm package gulp-bootlint receives a total of 115 weekly downloads. As such, gulp-bootlint popularity was classified as not popular.
We found that gulp-bootlint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.