# gulp-jslint-simple

> Run JSLint analysis

Latest version **1.0.2** (published 2016-04-01) · MIT license · 0 weekly downloads

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

## Install

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

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-04-01 |
| First published | 2014-06-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8.0 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Pandell Technology |
| Maintainers | pandell, milang |
| Keywords | gulpplugin, stream, lint, jslint |

## Links

- npm: https://www.npmjs.com/package/gulp-jslint-simple
- Repository: https://github.com/pandell/gulp-jslint-simple
- Issues: https://github.com/pandell/gulp-jslint-simple/issues
- npm.io page: https://npm.io/package/gulp-jslint-simple

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^1.0
- [xtend](https://npm.io/package/xtend.md) ^4.0
- [through2](https://npm.io/package/through2.md) ^0.6
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.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.2 (latest) — 2016-04-01
- 1.0.1 — 2015-05-29
- 1.0.0 — 2014-09-09
- 1.0.0-pre1 — 2014-09-09
- 0.2.2 — 2014-07-22
- 0.2.1 — 2014-07-10
- 0.2.0 — 2014-06-17
- 0.1.1 — 2014-06-11
- 0.1.0 — 2014-06-11
- 0.0.3 — 2014-06-10
- 0.0.2 — 2014-06-10
- 0.0.1 — 2014-06-09

## README

# [gulp](http://gulpjs.com/)-[jslint](http://www.jslint.com/)-simple

[![Build status](https://travis-ci.org/pandell/gulp-jslint-simple.svg?branch=master)](https://travis-ci.org/pandell/gulp-jslint-simple) [!["dependencies" status](https://david-dm.org/pandell/gulp-jslint-simple.svg)](https://david-dm.org/pandell/gulp-jslint-simple) [!["devDependencies" status](https://david-dm.org/pandell/gulp-jslint-simple/dev-status.svg)](https://david-dm.org/pandell/gulp-jslint-simple#info=devDependencies)

> Run JSLint analysis

[Git repository](https://github.com/pandell/gulp-jslint-simple)

[Changelog](https://github.com/pandell/gulp-jslint-simple/releases)

How is this package different from other JSLint runners?

- Contains a copy of the latest (2014-07-08) [JSLint](https://github.com/douglascrockford/JSLint/blob/master/jslint.js) by [Douglas Crockford](http://www.crockford.com/)

- Compatible with [JSHint reporters](https://www.npmjs.org/search?q=jshint%20reporter)

- [`jslint.report`](#jslintreportoptions) can emit `error` event:

    - Never (default behaviour)

    - After a file has been analysed and errors were found in it ([`emitError`](#optionsemiterror))

    - After all files have been analysed and errors were found in at least one of them ([`emitErrorAtEnd`](#optionsemiterroratend))


## Install

```sh
$ npm install --save-dev gulp-jslint-simple
```


## Usage

```js
var gulp = require('gulp');
var jslint = require('gulp-jslint-simple');

gulp.task('lint', function () {
    gulp.src('*.js')
        .pipe(jslint.run({
            // project-wide JSLint options
            node: true,
            vars: true
        }))
        .pipe(jslint.report({
            // example of using a JSHint reporter
            reporter: require('jshint-stylish').reporter
        }));
});
```


## API

Assuming:

```js
var jslint = require('gulp-jslint-simple');
```

### `jslint.run([options])`

Creates a transform stream that expects [Vinyl File](https://github.com/wearefractal/vinyl#file) objects in buffer mode (stream and null-contents modes are not supported) as input. The stream passes each incoming file object to the output unchanged. Each incoming object will be analysed using latest JSLint. If analysis fails, a property `jslint` will be added to the object. A property `jshint` pointing to `jslint` will also be added for compatibility with JSHint reporters.

#### options

_Type_: Object  
_Default_: no options

Options to pass through to `JSLINT` function. Allows overriding default JSLint flags on a project level (flags can then be overridden again at a file level using `/*jslint*/` comments).

#### options.includeData

_Type_: Boolean  
_Default_: false

If true, `jslint` property is added even when analysis succeeds. Additionally, `jslint.data` property is populated with `JSLINT.data()` object that contains analysis details.


### `jslint.report([options])`

Creates a transform stream that expects [Vinyl File](https://github.com/wearefractal/vinyl#file) objects as input. The stream passes each incoming file object to the output unchanged. Each incoming object that contains a file that failed JSLint analysis will be reported using `options.reporter`.

#### options

_Type_: Object  
_Default_: no options

Control report behaviour.

#### options.reporter

_Type_: Function  
_Default_: jslint.report.defaultReporter

Reporter to use to report errors for files that failed JSLint analysis.

#### options.emitError

_Type_: Boolean  
_Default_: false

If true, `jslint.report` will emit an `error` event when an incoming file fails JSLint analysis.

#### options.emitErrorAtEnd

_Type_: Boolean  
_Default_: false

If true, `jslint.report` will emit an `error` event after the input stream has ended and at least one file failed analysis.

If neither `options.emitError` nor `options.emitErrorAtEnd` are set to `true`, no `error` event will be emitted. `jslint.report` stream then acts as a simple pass-through transform stream.


### `jslint.report.defaultReporter(results, data, options)`

JSHint-reporter-compatible function that prints formatted message for each specified error result. File, line and row specification is printed in a format that is recognized by many editors and tools (clicking the file specification in such tools will open the specified file for editing at the specified location). Example output:

![Example default reporter output](https://cloud.githubusercontent.com/assets/42297/3203672/8f139672-ed9f-11e3-8863-859715e8bb40.png)


## Contributing

1. Clone git repository

2. `npm install` (will install dev dependencies needed by the next step)

3. `npm start` (will start a file system watcher that will re-lint JavaScript and JSON files + re-run all tests when change is detected)

4. Make changes, don't forget to add tests, submit a pull request.


## License

MIT © [Pandell Technology](http://pandell.com/)

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