All Projects → olegskl → Gulp Stylelint

olegskl / Gulp Stylelint

Licence: mit
Gulp plugin for running Stylelint results through various reporters.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gulp Stylelint

Husky.Net
Git hooks made easy with Husky.Net internal task runner! 🐶 It brings the dev-dependency concept to the .NET world!
Stars: ✭ 394 (+164.43%)
Mutual labels:  stylelint, linter
sonar-css-plugin
SonarQube CSS / SCSS / Less Analyzer
Stars: ✭ 46 (-69.13%)
Mutual labels:  stylelint, linter
vscode-linter
Extension for code linting, all in one package. New linters can be easily added through an extension framework.
Stars: ✭ 47 (-68.46%)
Mutual labels:  stylelint, linter
lints
Lint all your JavaScript, CSS, HTML, Markdown and Dockerfiles with a single command
Stars: ✭ 14 (-90.6%)
Mutual labels:  stylelint, linter
Vscode Stylelint
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 260 (+74.5%)
Mutual labels:  linter, stylelint
tryceratops
A linter to prevent exception handling antipatterns in Python (limited only for those who like dinosaurs).
Stars: ✭ 381 (+155.7%)
Mutual labels:  stylelint, linter
EditorConfig-Action
🔎A GitHub Action to check, enforce & fix EditorConfig style violations
Stars: ✭ 40 (-73.15%)
Mutual labels:  stylelint, linter
spec
🐣 easy to use eslint/stylelint/tslint/prettier/...
Stars: ✭ 60 (-59.73%)
Mutual labels:  stylelint, linter
elint
A easy way to lint your code
Stars: ✭ 38 (-74.5%)
Mutual labels:  stylelint, linter
stylelint-processor-glamorous
💄 Lint glamorous and related css-in-js with stylelint
Stars: ✭ 18 (-87.92%)
Mutual labels:  stylelint, linter
vscode-stylelint-plus
A Visual Studio Code extension to lint CSS/SCSS/Less with stylelint, support auto fix on save.
Stars: ✭ 32 (-78.52%)
Mutual labels:  stylelint, linter
Flake8
The official GitHub mirror of https://gitlab.com/pycqa/flake8
Stars: ✭ 1,112 (+646.31%)
Mutual labels:  linter, stylelint
Stylelint Processor Styled Components
Lint your styled components with stylelint!
Stars: ✭ 639 (+328.86%)
Mutual labels:  linter, stylelint
Lint Staged
🚫💩 — Run linters on git staged files
Stars: ✭ 9,492 (+6270.47%)
Mutual labels:  linter, stylelint
Stylelint Config Recess Order
🗂️ Recess-based property sort order for Stylelint.
Stars: ✭ 133 (-10.74%)
Mutual labels:  stylelint
Vscode Stylelint
Official Visual Studio Code extension to lint CSS/SCSS/Less with stylelint
Stars: ✭ 141 (-5.37%)
Mutual labels:  stylelint
Drstring
DrString finds issues in your Swift docstrings and fixes them for you.
Stars: ✭ 133 (-10.74%)
Mutual labels:  linter
Rstcheck
Checks syntax of reStructuredText and code blocks nested within it
Stars: ✭ 130 (-12.75%)
Mutual labels:  linter
Bento
[DEPRECATED] Find Python web-app bugs delightfully fast, without changing your workflow. 🍱
Stars: ✭ 147 (-1.34%)
Mutual labels:  linter
Stylelint Config Recommended Scss
The recommended shareable SCSS config for stylelint
Stars: ✭ 141 (-5.37%)
Mutual labels:  stylelint

gulp-stylelint

NPM version Build Status Dependency Status Join the chat at https://gitter.im/olegskl/gulp-stylelint

A Gulp plugin that runs stylelint results through a list of reporters.

Installation

npm install stylelint gulp-stylelint --save-dev

Quick start

Once you have configured stylelint (e.g. you have a .stylelintrc file), start with the following code. You will find additional configuration options below.

const gulp = require('gulp');

gulp.task('lint-css', function lintCssTask() {
  const gulpStylelint = require('gulp-stylelint');

  return gulp
    .src('src/**/*.css')
    .pipe(gulpStylelint({
      reporters: [
        {formatter: 'string', console: true}
      ]
    }));
});

Formatters

Below is the list of currently available stylelint formatters. Some of them are bundled with stylelint by default and exposed on gulpStylelint.formatters object. 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 stylelint
  • stylelint-checkstyle-formatter – requires installation

Options

gulp-stylelint supports all stylelint options except files and formatter and accepts a custom set of options listed below:

const gulp = require('gulp');

gulp.task('lint-css', function lintCssTask() {
  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.

Autofix

The fix: true option instructs stylelint to try to fix as many issues as possible. The fixes are applied to the gulp stream. The fixed content can be saved to file using gulp.dest.

const gulp = require('gulp');

gulp.task('fix-css', function fixCssTask() {
  const gulpStylelint = require('gulp-stylelint');

  return gulp
    .src('src/**/*.css')
    .pipe(gulpStylelint({
      fix: true
    }))
    .pipe(gulp.dest('src'));
});

License

MIT License

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