# grunt-jscs

> Grunt task for checking JavaScript Code Style with jscs.

Latest version **3.0.1** (published 2016-06-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install grunt-jscs
pnpm add grunt-jscs
yarn add grunt-jscs
bun add grunt-jscs
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2016-06-21 |
| First published | 2014-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+9 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 238 |
| Author | Gustavo Henke |
| Maintainers | gustavohenke, markelog |
| Keywords | gruntplugin, jscs, code style, checker |

## Links

- npm: https://www.npmjs.com/package/grunt-jscs
- Repository: https://github.com/jscs-dev/grunt-jscs
- Issues: https://github.com/jscs-dev/grunt-jscs/issues
- npm.io page: https://npm.io/package/grunt-jscs

## Dependencies (4)

- [vow](https://npm.io/package/vow.md) ~0.4.1
- [jscs](https://npm.io/package/jscs.md) ~3.0.5
- [hooker](https://npm.io/package/hooker.md) ~0.2.3
- [lodash](https://npm.io/package/lodash.md) ~4.6.1

## Recent versions

- 3.0.1 (latest) — 2016-06-21
- 3.0.0 — 2016-06-04
- 2.8.0 — 2016-03-02
- 2.7.0 — 2016-01-29
- 2.6.0 — 2016-01-04
- 2.5.0 — 2015-12-09
- 2.4.0 — 2015-12-02
- 2.3.0 — 2015-10-29
- 2.2.0 — 2015-10-25
- 2.1.0 — 2015-08-16
- 2.0.0 — 2015-07-27
- 1.8.0 — 2015-04-28
- 1.6.2 — 2015-04-28
- 1.7.0 — 2015-04-28
- 1.6.1 — 2015-04-28
- … 13 more at https://npm.io/package/grunt-jscs/versions

## README

# grunt-jscs
> Task for checking JavaScript Code Style with [jscs](https://github.com/jscs-dev/node-jscs).

[![Build Status](https://travis-ci.org/jscs-dev/grunt-jscs.svg?branch=master)](https://travis-ci.org/jscs-dev/grunt-jscs)
[![Dependency Status](https://david-dm.org/jscs-dev/grunt-jscs.svg)](https://david-dm.org/jscs-dev/grunt-jscs)
[![devDependency Status](https://david-dm.org/jscs-dev/grunt-jscs/dev-status.svg)](https://david-dm.org/jscs-dev/grunt-jscs#info=devDependencies)
[![NPM version](https://badge.fury.io/js/grunt-jscs.svg)](http://badge.fury.io/js/grunt-jscs)

## Getting started
This plugin requires Grunt `~0.4.2`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-jscs --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks("grunt-jscs");
```

## jscs task
_Run this task with the `grunt jscs` command._

Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide.

### Options
Any specified option will be passed through directly to JSCS, plus this plugin has additional options:

#### config
Type: `String`, `Boolean`
Default value: `true`

Defines how to externally load a JSCS configuration via the [JSCS config loader](http://jscs.info/overview.html#-config-).
The following is the behavior of this option:

- If set to a file path, then this file will be used;
- If set to `true`, JSCS will use its default config loading behavior;
- If set to `true` or to a file path with JSCS options specified in the grunt task, then they will be merged.

```js
jscs: {
    src: "path/to/files/*.js",
    options: {
        config: ".jscsrc",
        esnext: true, // If you use ES6 http://jscs.info/overview.html#esnext
        verbose: true, // If you need output with rule names http://jscs.info/overview.html#verbose
        fix: true, // Autofix code style violations when possible.
        requireCurlyBraces: [ "if" ]
    }
}
```

#### force
Type: `Boolean`
Default value: `false`

Set `force` to `true` to report JSCS errors but not fail the task.

#### reporter
Type: `String`
Default value: `null`

Allows you to modify the output. By default it will use a built-in `grunt` reporter. Set the path to your own custom reporter or to one of the built-in JSCS [reporters](https://github.com/jscs-dev/node-jscs/tree/master/lib/reporters).

#### reporterOutput
Type: `String`
Default value: `null`

Specify a filepath to output the results of a reporter. If `reporterOutput` is specified then all output will be written to the given filepath instead of printed to stdout.

### Usage examples
```js
jscs: {
    main: [ "path/to/files/*.js" ],
    secondary: {
        options: {
            config: ".jscs-secondary",
        },
        files: {
            src: [ "path/to/more/files/**/*.js", "my-plugin.js" ]
        }
    },
    ternary: {
        options: {
            requireCurlyBraces: [ "if" ]
        },
        files: {
            src: "happy-hippo.js"
        }
    }
}
```

## Release History
See the [releases page](https://github.com/jscs-dev/grunt-jscs/releases).

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