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.
Once all the little issues are fixed, it would be best to just squash and force-push the PR.
On Sep 7, 2014, at 11:14 AM, Joe Lencioni <notifications@github.com> wrote:

> In README.md:
> 
> > @@ -6,21 +6,21 @@ A wrapper around JSHint to allow linting of files containing JSX syntax.
> >  Accepts the same input and JSHint and emits the same output. Switches sent to jsxhint
> >  are forwarded on to jshint.
> >  
> > -Glob parsing, ignores, and jshintrc parsing are all performed by jshint. 
> > +Glob parsing, ignores, and jshintrc parsing are all performed by jshint.
> Do you want me to follow up with a whitespace trim commit?
> 
> —
> Reply to this email directly or view it on GitHub.
>