Skip to content

Commit 641b238

Browse files
committed
Run jshint over the exported node library as well.
1 parent 586ca73 commit 641b238

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

build.xml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,19 @@
8585
</exec>
8686
</target>
8787

88+
<!-- validate npm build file with JSHint -->
89+
<target name="lint.node" depends="build.node">
90+
<exec executable="java" failonerror="true">
91+
<arg line="-jar"/>
92+
<arg path="${lib.dir}/js.jar"/>
93+
<arg line="-opt -1"/>
94+
<arg path="${lib.dir}/jshint.js" />
95+
<arg path="${build.dir}/${node.build.file}" />
96+
</exec>
97+
</target>
98+
8899
<!-- run tests on the command line -->
89-
<target name="test" depends="lint,build.all">
100+
<target name="test" depends="lint,build.all,lint.node">
90101
<apply executable="java" failonerror="true">
91102
<arg line="-Xss16M"/>
92103
<fileset dir="${tests.dir}" includes="**/*.js"/>
@@ -179,17 +190,23 @@
179190
<target name="build.node">
180191

181192
<concat destfile="${build.dir}/${node.build.file}" fixlastline="true">
182-
<header trimleading="yes">
183-
"use strict";
193+
<header trimleading="yes">/* jshint node:true, latedef:false */
194+
"use strict"; // jshint ignore:line
184195
</header>
185196
<filelist dir="${build.dir}" files="${core.build.file}, ${css.build.file}"/>
186197
<footer trimleading="yes">
187198
(function(){
199+
/* jshint forin:false */
188200
for(var prop in parserlib){
189201
exports[prop] = parserlib[prop];
190202
}
191203
})();
192204
</footer>
205+
<filterchain>
206+
<linecontainsregexp negate="true">
207+
<regexp pattern="^/[*](global|exported) .*[*]/$"/>
208+
</linecontainsregexp>
209+
</filterchain>
193210
</concat>
194211

195212
<mkdir dir="${build.npm.dir}"/>

0 commit comments

Comments
 (0)