Skip to content

gildur/jshint4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jshint4j

Java wrapper for JSHint (http://www.jshint.com/).

Build Status

Usage

Add dependency to your project:

<dependency>
    <groupId>pl.gildur</groupId>
    <artifactId>jshint4j</artifactId>
    <version>1.0.1</version>
</dependency>

Use it in your code:

JsHint jsHint = new JsHint();
String source = "function test() { return x; }";
String options = "{ undef: true }";
List<Error> errors = jsHint.lint(source, options);
for (Error error : errors) {
    System.out.printf("JSHint error on line %d, character %d: %s",
            error.getLine(),
            error.getCharacter(),
            error.getReason());
}

License

MIT