# gulp-jslint

> The classic and strict javascript lint-tool for gulp.js

Latest version **1.0.10** (published 2016-12-18) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install gulp-jslint
pnpm add gulp-jslint
yarn add gulp-jslint
bun add gulp-jslint
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.10 |
| Published | 2016-12-18 |
| First published | 2014-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Karim Alibhai |
| Maintainers | karimsa |
| Keywords | gulp, gulpplugin, jslint, lint, code quality |

## Links

- npm: https://www.npmjs.com/package/gulp-jslint
- Repository: https://github.com/karimsa/gulp-jslint
- Homepage: https://github.com/karimsa/gulp-jslint#readme
- Issues: https://github.com/karimsa/gulp-jslint/issues
- npm.io page: https://npm.io/package/gulp-jslint

## Dependencies (7)

- [rc](https://npm.io/package/rc.md) ^1.1.6
- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [jslint](https://npm.io/package/jslint.md) 0.10.3
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.7
- [map-stream](https://npm.io/package/map-stream.md) 0.0.6
- [strip-ansi](https://npm.io/package/strip-ansi.md) ^3.0.1
- [jshint-stylish](https://npm.io/package/jshint-stylish.md) ^2.2.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 1.0.10 (latest) — 2016-12-18
- 1.0.9 — 2016-12-14
- 1.0.8 — 2016-12-14
- 1.0.6 — 2016-12-14
- 1.0.5 — 2016-09-07
- 1.0.4 — 2016-08-18
- 1.0.3 — 2016-08-18
- 1.0.1 — 2016-04-23
- 0.2.2 — 2015-01-07
- 0.2.1 — 2014-12-04
- 0.2.0 — 2014-12-04
- 0.1.9 — 2014-11-04
- 0.1.8 — 2014-10-14
- 0.1.7 — 2014-08-27
- 0.1.6 — 2014-07-21
- … 14 more at https://npm.io/package/gulp-jslint/versions

## README

# gulp-jslint [![Build Status](https://img.shields.io/travis/karimsa/gulp-jslint/master.svg?maxAge=2592000)](https://travis-ci.org/karimsa/gulp-jslint) [![View on NPM](http://img.shields.io/npm/dm/gulp-jslint.svg?style=flat)](http://npmjs.org/package/gulp-jslint) [![code climate](http://img.shields.io/codeclimate/github/karimsa/gulp-jslint.svg?style=flat)](https://codeclimate.com/github/karimsa/gulp-jslint) [![code coverage](http://img.shields.io/codeclimate/coverage/github/karimsa/gulp-jslint.svg?style=flat)](https://codeclimate.com/github/karimsa/gulp-jslint)

It's JSLint for Gulp.js.

[![NPM](https://nodei.co/npm/gulp-jslint.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/gulp-jslint/)

Supports `node >= 0.10.x`.

## Table of Contents

 - [Installation](#installation)
 - [Usage](#usage)
    - [Directives](#directives)
 - [Reporters](#reporters)
    - [Custom Reporters](#custom-reporters)
 - [Support and Licensing](#support-and-licensing)

## Installation

Simply install with npm by running `npm install gulp-jslint`.

## Usage

```javascript
var gulp = require('gulp');
var jslint = require('gulp-jslint');

gulp.task('default', function () {
    return gulp.src(['source.js'])
            .pipe(jslint({ /* this object represents the JSLint directives being passed down */ }))
            .pipe(jslint.reporter( 'my-reporter' ));
});
```

If you would like to specify a custom jslint edition to use, set the property 'edition' in your directives object.
These versions should follow what the package node-jslint expects or this property can be set to a pre-loaded jslint
function.

### Directives

All directives being passed to the `jslint()` function are standard JSLint directives (for a list of directives,
see [the official JSLint docs](http://www.jslint.com/help.html)).

However, to supply a list of global variables for your code, use the directive 'predef' or 'global' like so ('global'
is an alias of 'predef' but 'predef' will be prefered since it is the official JSLint standard):

```javascript
gulp.task('default', function () {
    return gulp.src(['source.js'])
            .pipe(jslint({
                predef: [ 'a_global' ],
                global: [ 'a_global' ]
            }));
});
```

*Please see `gulpfile.js` for a more extensive sample gulpfile.*

## Reporters

By default, two reporters are provided by gulp-jslint. The first is the default reporter (appropriately named 'default')
and the second report is the popular 'jshint-stylish' (named 'stylish').

To use either of these reporters, provide the name of the reporter followed by whatever arguments they expect to the function
`jslint.reporter()`.

**For example:**

```javascript
gulp.task('default', function () {
    return gulp.src(['source.js'])
            .pipe(jslint())
            .pipe(jslint.reporter('default', errorsOnly))
            .pipe(jslint.reporter('stylish', options));
});
```

It's probably a good idea to use something like `path.basename()` on the `file` property to avoid lots of garbage in the
command-line (i.e. path.basename('/path/to/index.js') === 'index.js').

### Custom Reporters

Custom reporters should be either be synchronous or streams. Either way, the reporter will receive a `results` object and can
output its report onto the console/logfile the way it wishes.

The results object will contain the following properties:

 - *filename*: the absolute path to the file being linted.
 - *success*: a boolean value representing whether the linting passed.
 - *errors*: an array of JSLint errors. Each element will contain the properties:
    - *name*: the string 'JSLintError'.
    - *column*: the column number of the error.
    - *line*: the line number of the error.
    - *code*: a code relating to the error.
    - *message*: a message describing the error.

## Support and Licensing

Copyright (C) 2014-2016 Karim Alibhai.
Code is licensed under the MIT license.

Please use the official issues section in GitHub to post issues or feature requests.
Stars and helpful comments are much appreciated! :)

---
_Source: https://npm.io/package/gulp-jslint · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
