STRML/JSXHint — pull request #19 by lencioni (2014-09-07 15:00:32+00:00)
Title: Add --force-transform CLI option

The JSX to JS transform happens before sending the file off to jshint if
and only if the file ends in ".jsx" or the file contains the JSX
docblock pragma.

However, some projects may be using JSX without either .jsx extension on
the filename or the JSX docblock pragma (e.g. if it is automatically
added as part of the build phase). For these projects, the JSX to JS
transform does not happen which makes JSXHint not work for these files.

The options that I see to make this work are:

1. Always run the transform on all files, regardless of extension or
contents.
2. Improve JSX detection in a way that doesn't just look for the
docblock pragma.
3. Add a CLI flag that forces the transform to happen.

The first option would be simplest and okay with me for small codebases,
but would unnecessarily slow down large ones so I'd prefer to avoid it.
However, now that the JSX standard draft has been published and it
doesn't mention the pragma docblock, something in that direction might
become necessary.

Second could potentially be done by searching for something like
`React.` but that seems pretty brittle.

Third should be simple enough to add and gives people the control they
need for their projects, and is the approach that this commit takes.

The transform happens inside of a callback in jshint. This callback
happens after jshint validates that all of the options it received are
valid. As a result of that, we need to filter out JSXHint-specific
options, store them somewhere, and then inject them back into the
options before the transform step happens.

Closes #18.