-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update of jshint to 2.1.4 #29
Comments
Phil, let me know if we can do anything to help get this going. I'm super new to jshint but I need to get our build going with a 2.x version so it doesn't differ so much from my team's use of the eclipse plugin. If you have an idea of how hard it will be to upgrade the plugin let me know and I may be able to contribute. |
Let me see this weekend. |
Is it possible, to change the request to jshint 2.1.6? The new version came out just yesterday: http://www.jshint.com/blog/2013-07-28/2-1-6/ . Thank you! |
I ended up just exec tasking to the jshint command line. That'll do for me for now. |
Any news on that issue? We are using the jshint-eclipse integration plugin in the development environment. This plugin is using the version 2.1.10 of jshint in which some behavior has changed (for ex for trailing whitespace in the comments...) As a consequence we would like to use the same version of jshint in our ant-based build. Thanks, |
@kruser Can you show me the way you achieve this? Thanks in advance! :) |
@Knusp - it's more simple on unix-only. Someone here has updated our builds to work on either NodeJS for windows or linux though, so here are those details. First, install NodeJS and the jshint module. Then, in your Ant build file, define the module that can exec to this jshint module on either OS: <macrodef name="exec-node">
<attribute name="module" description="The name of the NodeJS module to execute"/>
<attribute name="failonerror" default="true" description="Fail if the exit code is not 0"/>
<element name="args" implicit="yes" description="Argument to pass to the exec task"/>
<sequential>
<exec executable="cmd.exe" failonerror="@{failonerror}" osfamily="winnt">
<!-- Windows cmd output workaround: http://stackoverflow.com/a/10359327/227349 -->
<!-- Forces node's stderror and stdout to a temporary file -->
<arg line=" > _tempfile.out 2<&1"/>
<!-- If command exits with an error, then output the temporary file -->
<!-- to stdout delete the temporary file and finally exit with error level 1 -->
<!-- so that the apply task can catch the error if @failonerror="true" -->
<arg line=" || (type _tempfile.out & del _tempfile.out & exit /b 1)"/>
<!-- Otherwise, just type the temporary file and delete it-->
<arg line=" & type _tempfile.out & del _tempfile.out &"/>
<arg line="/c @{module}" />
<args/>
</exec>
<exec executable="@{module}" failonerror="@{failonerror}" osfamily="unix">
<args/>
</exec>
</sequential>
</macrodef> Then we simple add a new target that allows us to 'ant jshint'. The node executable sends back the correct return code and we failonerror in our macro definition such that our continuous build server does the right thing. <target name="jshint">
<echo message="Executing jshint against the source"></echo>
<exec-node module="jshint">
<arg value="--config=../coding-standards/jshint/options.json" />
<arg value="${src.dir}" />
</exec-node>
</target> |
Thank you @kruser ! :) I encountered an "out of range index exception" with the current versions of JSHint (2.2 to 2.4.2), so I had to downgrade to 2.1.11: https://raw2.github.com/jshint/jshint/2.2.0/dist/jshint-rhino.js FYI: This bug will be fixed soon: jshint/jshint#1333 |
FWIW, I've submitted a pull request (#32) that upgrades ant-jshint to use JSHint 2.4.4, and which works around the JSHint/Rhino problems. |
Thank You!
The text was updated successfully, but these errors were encountered: