davidB / yuicompressor-maven-plugin

maven's plugin to compress (Minify / Ofuscate / Aggregate) Javascript files and CSS files using YUI Compressor
http://davidb.github.io/yuicompressor-maven-plugin/
GNU Lesser General Public License v2.1
122 stars 48 forks source link

How to pass config params to JSLint #17

Closed pakmans closed 11 years ago

pakmans commented 14 years ago

JSLint allows to configure its behaviour. Is there a way to pass such parameter to JSLint?

davidB commented 14 years ago

other than
http://alchim31.net/mvnsites/yuicompressor-maven-plugin/jslint-mojo.html

?

pakmans commented 14 years ago

I mean JSLint specific parameters like:

white: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, indent: 2

As well as predifined Objects.

Great plug-in by the way, thank you.

davidB commented 14 years ago

currently it's not supported to define jslint's option into pom.xml (patch welcome, I don't have time to work on it during next 2 week).

you can use comment (extract from jslint doc) :

Options can also be specified within a script with a /jslint / comment:

/jslint nomen: true, debug: true, evil: false, onevar: true /

/davidB

davidB commented 14 years ago

the plugin use the Rhino edition of Jslint, and only option via comments seems to be supported.

http://www.jslint.com/rhino/index.html

pakmans commented 14 years ago

For now, I simply modified the jslint.js file included in your plugin. You could probably use this guy's version which supports passing command line arguments: http://www.corybennett.org/projects/ If I have time I'll try to integrate it with your plugin.

snoopy96 commented 12 years ago

Is there a way to pass the jslint options without changing the yuicompressor-maven-plugin? Can't find it in the documentation...

davidB commented 12 years ago

Hi, see messag above you can add comment into your js file (see doc of jslint)