
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
gulp-stylelint
Advanced tools
Gulp plugin for running Stylelint results through various reporters.
A Gulp plugin that runs stylelint results through a list of reporters.
npm install gulp-stylelint --save-dev
With gulp-stylelint, it's easy to generate CSS lint reports based on stylelint results.
Once you have configured stylelint (e.g. you have a .stylelintrc file), start with the following code. You will find additional configuration options below.
gulp.task('lint-css', function lintCssTask() {
const gulp = require('gulp');
const gulpStylelint = require('gulp-stylelint');
return gulp
.src('src/**/*.css')
.pipe(gulpStylelint({
reporters: [
{formatter: 'string', console: true}
]
}));
});
Below is the list of currently available stylelint formatters. Some of them are bundled with stylelint by default and exposed on gulpStylelint.formatters
. Others need to be installed. You can write a custom formatter to tailor the reporting to your needs.
"string"
(same as gulpStylelint.formatters.string
) – bundled with stylelint"verbose"
(same as gulpStylelint.formatters.verbose
) – bundled with stylelint"json"
(same as gulpStylelint.formatters.json
) – bundled with stylelintBelow is an example with all available options provided:
gulp.task('lint-css', function lintCssTask() {
const gulp = require('gulp');
const gulpStylelint = require('gulp-stylelint');
const myStylelintFormatter = require('my-stylelint-formatter');
return gulp
.src('src/**/*.css')
.pipe(gulpStylelint({
failAfterError: true,
reportOutputDir: 'reports/lint',
reporters: [
{formatter: 'verbose', console: true},
{formatter: 'json', save: 'report.json'},
{formatter: myStylelintFormatter, save: 'my-custom-report.txt'}
],
debug: true
}));
});
failAfterError
When set to true
, the process will end with non-zero error code if any error-level warnings were raised. Defaults to true
.
reportOutputDir
Base directory for lint results written to filesystem. Defaults to current working directory.
reporters
List of reporter configuration objects (see below). Defaults to an empty array.
{
// stylelint results formatter (required):
// - pass a function for imported, custom or exposed formatters
// - pass a string ("string", "verbose", "json") for formatters bundled with stylelint
formatter: myFormatter,
// save the formatted result to a file (optional):
save: 'text-report.txt',
// log the formatted result to console (optional):
console: true
}
debug
When set to true
, the error handler will print an error stack trace. Defaults to false
.
FAQs
Gulp plugin for running Stylelint results through various reporters.
The npm package gulp-stylelint receives a total of 18,248 weekly downloads. As such, gulp-stylelint popularity was classified as popular.
We found that gulp-stylelint 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.