# grunt-jsxhint

> jshint for jsx

Latest version **0.8.0** (published 2016-03-22) · MIT license · 0 weekly downloads

## Install

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

## 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.8.0 |
| Published | 2016-03-22 |
| First published | 2014-06-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Till Arnold |
| Maintainers | tillarnold |
| Keywords | gruntplugin, jsx, react, jshint, jsxhint |

## Links

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

## Dependencies (4)

- [jshint](https://npm.io/package/jshint.md) ~2.9.1
- [rewire](https://npm.io/package/rewire.md) ~2.5.1
- [proxyquire](https://npm.io/package/proxyquire.md) ~1.7.4
- [grunt-contrib-jshint](https://npm.io/package/grunt-contrib-jshint.md) 1.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.8.0 (latest) — 2016-03-22
- 0.7.0 — 2016-03-01
- 0.6.0 — 2015-04-07
- 0.5.0 — 2015-02-06
- 0.4.0 — 2014-10-29
- 0.3.0 — 2014-08-14
- 0.2.0 — 2014-08-04
- 0.1.0 — 2014-07-15
- 0.0.3 — 2014-07-11
- 0.0.2 — 2014-06-20
- 0.0.1 — 2014-06-19

## README

#grunt-jsxhint [![Dependency Status](https://david-dm.org/tillarnold/grunt-jsxhint.svg)](https://david-dm.org/tillarnold/grunt-jsxhint)

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

> Like [grunt-contrib-jshint](https://github.com/gruntjs/grunt-contrib-jshint) but compatible with [react's](https://github.com/facebook/react) jsx

## Getting Started
This plugin requires Grunt `~0.4.0`

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-jsxhint --save-dev
```

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

```js
grunt.loadNpmTasks('grunt-jsxhint');
```

## Jshint task
This grunt plugin works exactly like [grunt-contrib-jshint](https://github.com/gruntjs/grunt-contrib-jshint). In fact it's even using `grunt-contrib-jshint`. The only difference to `grunt-contrib-jshint` is that this plugin runs `require('bable-core').transform(code, {plugins: ["transform-react-jsx"]});` on every file passed in. This will transform the jsx syntax to regular JavaScript. Non jsx-files will be unchanged. Line numbers are preserved by jsx so the line numbers outputted by jshint will be correct.

This is a drop in replacement for `grunt-contrib-jshint`. So you can just replace the `grunt-contrib-jshint` dependency in your `package.json` with `grunt-jsxhint`.

`grunt-jsxhint` needs `bable-core` and `babel-plugin-transform-react-jsx` to work. If you don't have either installed run

```shell
npm install babel-core babel-plugin-transform-react-jsx --save-dev
```


Use exactly like `grunt-contrib-jshint`:


```js
jshint: {
  //Everything like in grunt-contrib-jshint
}
```

## Parsed filed extensions
By default, your jsx files need to have a `.jsx` or `.react.js` file extension. In order to parse other files, add the following into your jshint options object:

```js
jshint: {
    options: {
        jshintrc: '.jshintrc',
        ignores: [],
        additionalSuffixes: ['.js']
    },
}
```

These suffixes are concatenated onto .jsx and .react.js.

## Contributing

If `grunt-jsxhint` is lacking a feature or if you found bug (or a typo in the README) feel free to submit a pull request or file an issue.


## Release History
* 2016-03-22   v0.8.0   Update dependencies.
* 2016-03-01   v0.7.0   Use babel.
* 2015-04-07   v0.6.0   Add `additionalSuffixes` option.
* 2015-02-06   v0.5.0   Update dependencies and remove /** @jsx React.DOM */
* 2014-10-29   v0.4.0   Add support for `.react.js` suffix
* 2014-08-14   v0.3.0   Improve error messages. Use locally installed react-tool.
* 2014-08-04   v0.2.0   Add check for /** @jsx React.DOM */. Upgrade react-tools.
* 2014-07-15   v0.1.0   Stop transforming non jsx files.
* 2014-07-12   v0.0.3   Use absolute version of grunt-contrib-jshint.
* 2014-06-20   v0.0.2   Add MIT licence. Update README.
* 2014-06-19   v0.0.1   Initial version.

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