|
85 | 85 | </exec> |
86 | 86 | </target> |
87 | 87 |
|
| 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 | + |
88 | 99 | <!-- run tests on the command line --> |
89 | | - <target name="test" depends="lint,build.all"> |
| 100 | + <target name="test" depends="lint,build.all,lint.node"> |
90 | 101 | <apply executable="java" failonerror="true"> |
91 | 102 | <arg line="-Xss16M"/> |
92 | 103 | <fileset dir="${tests.dir}" includes="**/*.js"/> |
|
179 | 190 | <target name="build.node"> |
180 | 191 |
|
181 | 192 | <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 |
184 | 195 | </header> |
185 | 196 | <filelist dir="${build.dir}" files="${core.build.file}, ${css.build.file}"/> |
186 | 197 | <footer trimleading="yes"> |
187 | 198 | (function(){ |
| 199 | + /* jshint forin:false */ |
188 | 200 | for(var prop in parserlib){ |
189 | 201 | exports[prop] = parserlib[prop]; |
190 | 202 | } |
191 | 203 | })(); |
192 | 204 | </footer> |
| 205 | + <filterchain> |
| 206 | + <linecontainsregexp negate="true"> |
| 207 | + <regexp pattern="^/[*](global|exported) .*[*]/$"/> |
| 208 | + </linecontainsregexp> |
| 209 | + </filterchain> |
193 | 210 | </concat> |
194 | 211 |
|
195 | 212 | <mkdir dir="${build.npm.dir}"/> |
|
0 commit comments