Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lesshint/gulp-lesshint
Lint your .less files from Gulp with lesshint.
https://github.com/lesshint/gulp-lesshint
gulp lesshint
Last synced: 5 days ago
JSON representation
Lint your .less files from Gulp with lesshint.
- Host: GitHub
- URL: https://github.com/lesshint/gulp-lesshint
- Owner: lesshint
- License: mit
- Created: 2015-06-11T11:37:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-30T18:38:48.000Z (almost 5 years ago)
- Last Synced: 2024-09-18T16:44:36.015Z (17 days ago)
- Topics: gulp, lesshint
- Language: JavaScript
- Size: 680 KB
- Stars: 14
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# gulp-lesshint
[![Build Status](https://travis-ci.org/lesshint/gulp-lesshint.svg?branch=master)](https://travis-ci.org/lesshint/gulp-lesshint)## Installation
```bash
npm install gulp-lesshint --save-dev
```## Usage
```js
const gulp = require('gulp');
const lesshint = require('gulp-lesshint');gulp.task('lint', () => {
return gulp.src('./src/*.less')
.pipe(lesshint({
// Options
}))
.pipe(lesshint.reporter('reporter-name')) // Leave empty to use the default, "stylish"
.pipe(lesshint.failOnError()) // Use this to fail the task on lint errors
.pipe(lesshint.failOnWarning()); // Use this to fail the task on lint warnings
});
```## Options
* `configPath`
* Pass a path to a valid configuration file and stop lesshint from looking for a `.lesshintrc` file.
* `maxWarnings`
* The maximum number of warnings to allow, before failing the task. Omit this option to always allow the task to pass.## API
* `lesshint.failOnError()`
* Use this to fail the task when there are at least one lint result with a severity of `error`.
* `lesshint.failOnWarning()`
* Use this to fail the task when there are at least one lint result with a severity of `warning`.**NOTE**: this does not respect the `maxWarnings` option.## Reporters
If no reporter name is passed, the default `lesshint-reporter-stylish` will be used which just prints everything with different colors.
If you wish to specify your own, please refer to the [lesshint reporter loading steps](https://github.com/lesshint/lesshint/blob/master/docs/user-guide/reporters.md#the-reporter-loading-steps)
for the exact logic.## Result
The following properties will be added to the `file` object.```js
file.lesshint.success = true; // or false
file.lesshint.resultCount = 0; // number of results returned by lesshint
file.lesshint.results = []; // lesshint results
```