# grunt-jshint-only

> A plugin to run only code against only some jshint options.

Latest version **0.1.0** (published 2015-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install grunt-jshint-only
pnpm add grunt-jshint-only
yarn add grunt-jshint-only
bun add grunt-jshint-only
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-02-27 |
| First published | 2015-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.0 |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Emily Coco |
| Maintainers | emilycoco |
| Keywords | gruntplugin, jshint, only, jslint |

## Links

- npm: https://www.npmjs.com/package/grunt-jshint-only
- Repository: https://github.com/emilycoco/grunt-jshint-only
- Issues: https://github.com/emilycoco/grunt-jshint-only/issues
- npm.io page: https://npm.io/package/grunt-jshint-only

## Dependencies (7)

- [grunt](https://npm.io/package/grunt.md) ~0.4.2
- [jshint](https://npm.io/package/jshint.md) ^2.6.0
- [jshint-stylish](https://npm.io/package/jshint-stylish.md) ~0.1.5
- [load-grunt-tasks](https://npm.io/package/load-grunt-tasks.md) ~0.3.0
- [grunt-contrib-clean](https://npm.io/package/grunt-contrib-clean.md) ~0.5.0
- [grunt-contrib-jshint](https://npm.io/package/grunt-contrib-jshint.md) ^0.10.0
- [grunt-contrib-nodeunit](https://npm.io/package/grunt-contrib-nodeunit.md) ~0.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
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2015-02-27
- 0.0.9 — 2015-02-25
- 0.0.8 — 2015-02-25
- 0.0.7 — 2015-02-25
- 0.0.6 — 2015-02-25
- 0.0.5 — 2015-02-25
- 0.0.4 — 2015-02-25
- 0.0.3 — 2015-01-22
- 0.0.2 — 2015-01-22
- 0.0.1 — 2015-01-22

## README

# grunt-jshint-only

> A plugin to run code against only some jshint options.

## Getting Started
This plugin requires Grunt.

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-jshint-only --save-dev
```

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

```js
grunt.loadNpmTasks('grunt-jshint-only');
```

## The "jshint_only" task
_Run this task with the `grunt jshint_only` command._

### Overview
Most jshint grunt tasks will fail if any non-optional errors are encountered, this task allows you to specify exactly which errors will cause failures.
Find error codes here: [Jshint errors](http://jslinterrors.com).
In your project's Gruntfile, add a section named `jshint_only` to the data object passed into `grunt.initConfig()`.


```js
grunt.initConfig({
  jshint_only: {
    options: {
      only: ['W022'] //array of jshint option codes to fail grunt task if found, all others will be recorded, but not fail the task.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})
```

### Options

#### options.separator
Type: `String`
Default value: `',  '`

A string value that is used to do something with whatever.

#### options.punctuation
Type: `String`
Default value: `'.'`

A string value that is used to do something else with whatever else.

### Usage Examples

#### Default Options
In this example, the codes 'W024' and 'W033' are passed in, so this task will fail only if either of the below errors are encountered in the scanned files:
W024: Expected an identifier and instead saw '{a}' (a reserved word)
W002: Value of '{a}' may be overwritten in IE8 and earlier

If you are checking for errors that jshint does not fail on default, for example, W024, set the error to true in options for the task.


```js
grunt.initConfig({
  jshint_only: {
    options: {
      es3: true,
      only: ['W024', 'W002']
    },
    files: {
      'dest': ['myApp/scripts/{,*/}*.js']
    },
  },
})
```

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).

## Release History
_(Nothing yet)_

## License
Copyright (c) 2015 Emily Coco. Licensed under the MIT license.

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