{"id":13397830,"url":"https://github.com/olegskl/gulp-stylelint","last_synced_at":"2025-04-04T11:14:07.665Z","repository":{"id":3083224,"uuid":"48388067","full_name":"olegskl/gulp-stylelint","owner":"olegskl","description":"Gulp plugin for running Stylelint results through various reporters.","archived":false,"fork":false,"pushed_at":"2024-05-10T07:41:33.000Z","size":566,"stargazers_count":150,"open_issues_count":26,"forks_count":30,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-27T12:05:20.631Z","etag":null,"topics":["css","gulp-plugin","gulp-stylelint","linter","stylelint"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olegskl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-12-21T18:41:26.000Z","updated_at":"2025-01-31T14:02:21.000Z","dependencies_parsed_at":"2024-06-18T12:36:43.320Z","dependency_job_id":null,"html_url":"https://github.com/olegskl/gulp-stylelint","commit_stats":{"total_commits":119,"total_committers":14,"mean_commits":8.5,"dds":0.2941176470588235,"last_synced_commit":"95921fed4cea5b11feb04395675d3abeb38464db"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegskl%2Fgulp-stylelint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegskl%2Fgulp-stylelint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegskl%2Fgulp-stylelint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olegskl%2Fgulp-stylelint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olegskl","download_url":"https://codeload.github.com/olegskl/gulp-stylelint/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166168,"owners_count":20894654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","gulp-plugin","gulp-stylelint","linter","stylelint"],"created_at":"2024-07-30T18:01:47.694Z","updated_at":"2025-04-04T11:14:07.638Z","avatar_url":"https://github.com/olegskl.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# gulp-stylelint\n\n[![NPM version](http://img.shields.io/npm/v/gulp-stylelint.svg)](https://www.npmjs.org/package/gulp-stylelint)\n[![Build Status](https://travis-ci.org/olegskl/gulp-stylelint.svg?branch=master)](https://travis-ci.org/olegskl/gulp-stylelint)\n[![Dependency Status](https://david-dm.org/olegskl/gulp-stylelint.svg)](https://david-dm.org/olegskl/gulp-stylelint)\n[![Join the chat at https://gitter.im/olegskl/gulp-stylelint](https://badges.gitter.im/olegskl/gulp-stylelint.svg)](https://gitter.im/olegskl/gulp-stylelint?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nA [Gulp](http://gulpjs.com/) plugin that runs [stylelint](https://github.com/stylelint/stylelint) results through a list of reporters.\n\n## Installation\n\n```bash\nnpm install stylelint gulp-stylelint --save-dev\n```\n\n## Quick start\n\nOnce you have [configured stylelint](http://stylelint.io/user-guide/configuration/) (e.g. you have a *.stylelintrc* file), start with the following code. You will find additional configuration [options](#options) below.\n\n```js\nconst gulp = require('gulp');\n\ngulp.task('lint-css', function lintCssTask() {\n  const gulpStylelint = require('gulp-stylelint');\n\n  return gulp\n    .src('src/**/*.css')\n    .pipe(gulpStylelint({\n      reporters: [\n        {formatter: 'string', console: true}\n      ]\n    }));\n});\n```\n\n## Formatters\n\nBelow 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](http://stylelint.io/developer-guide/formatters/) to tailor the reporting to your needs.\n\n - `\"string\"` (same as `gulpStylelint.formatters.string`) – bundled with stylelint\n - `\"verbose\"` (same as `gulpStylelint.formatters.verbose`) – bundled with stylelint\n - `\"json\"` (same as `gulpStylelint.formatters.json`) – bundled with stylelint\n -  [stylelint-checkstyle-formatter](https://github.com/davidtheclark/stylelint-checkstyle-formatter) – requires installation\n\n## Options\n\ngulp-stylelint supports all [stylelint options](http://stylelint.io/user-guide/node-api/#options) except [`files`](http://stylelint.io/user-guide/node-api/#files) and [`formatter`](http://stylelint.io/user-guide/node-api/#formatter) and accepts a custom set of options listed below:\n\n```js\nconst gulp = require('gulp');\n\ngulp.task('lint-css', function lintCssTask() {\n  const gulpStylelint = require('gulp-stylelint');\n  const myStylelintFormatter = require('my-stylelint-formatter');\n\n  return gulp\n    .src('src/**/*.css')\n    .pipe(gulpStylelint({\n      failAfterError: true,\n      reportOutputDir: 'reports/lint',\n      reporters: [\n        {formatter: 'verbose', console: true},\n        {formatter: 'json', save: 'report.json'},\n        {formatter: myStylelintFormatter, save: 'my-custom-report.txt'}\n      ],\n      debug: true\n    }));\n});\n```\n\n#### `failAfterError`\n\nWhen set to `true`, the process will end with non-zero error code if any error-level warnings were raised. Defaults to `true`.\n\n#### `reportOutputDir`\n\nBase directory for lint results written to filesystem. Defaults to current working directory.\n\n#### `reporters`\n\nList of reporter configuration objects (see below). Defaults to an empty array.\n\n```js\n{\n  // stylelint results formatter (required):\n  // - pass a function for imported, custom or exposed formatters\n  // - pass a string (\"string\", \"verbose\", \"json\") for formatters bundled with stylelint\n  formatter: myFormatter,\n\n  // save the formatted result to a file (optional):\n  save: 'text-report.txt',\n\n  // log the formatted result to console (optional):\n  console: true\n}\n```\n\n#### `debug`\n\nWhen set to `true`, the error handler will print an error stack trace. Defaults to `false`.\n\n## Autofix\n\nThe `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`.\n\n```js\nconst gulp = require('gulp');\n\ngulp.task('fix-css', function fixCssTask() {\n  const gulpStylelint = require('gulp-stylelint');\n\n  return gulp\n    .src('src/**/*.css')\n    .pipe(gulpStylelint({\n      fix: true\n    }))\n    .pipe(gulp.dest('src'));\n});\n```\n\n## License\n\n[MIT License](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folegskl%2Fgulp-stylelint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folegskl%2Fgulp-stylelint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folegskl%2Fgulp-stylelint/lists"}