Giter Club home page Giter Club logo

jshint-mojo's Introduction

Simple JSHint Mojo Maven Central

It's real simple and it runs JSHint on your *.js files.

Goals

  • jshint:lint: runs jshint on your files (per your configuration settings)

Configuration Options

Option Default Value Explanation
version 2.5.6 Selects which embedded version of JSHint will be used
options List of comma-separated JSHint options
globals List of comma-separated JSHint globals
configFile Path to a JSHint JSON config file. Its contents will override values set in options and globals, if present. Please note that block and line comments will be stripped prior to processing so it's OK to include them.
directories <directory>src</directory> Locations in which the plugin will search for *.js files
excludes Excludes are resolved relative to the basedir of the module
reporter If present, JSHint will generate a reporting file which can be used for some CI tools. Currently, jslint, html, and checkstyle formats are supported.
reportFile target/jshint.xml Path to an output reporting file
failOnError true Controls whether the plugin fails the build when JSHint is unhappy. Setting this to false is discouraged, as it removes most of the benefit of using this plugin. Instead, if you have problem files that you can't fix disable/override JSHint on a per-file basis, or tell the plugin to specifically exclude them in the excludes section

Example Configurations

<plugin>
     <groupId>com.cj.jshintmojo</groupId>
     <artifactId>jshint-maven-plugin</artifactId>
     <executions>
         <execution>
             <goals>
                 <goal>lint</goal>
             </goals>
         </execution>
     </executions>
     <configuration>
         <version>2.4.3</version>
         <options>maxparams:3,indent,camelcase,eqeqeq,forin,immed,latedef,noarg,noempty,nonew</options>
         <globals>require,$,yourFunkyJavascriptModule</globals>
         <configFile>src/main/resources/jshint.conf.js</configFile>
         <directories>
             <directory>src/main/javascript</directory>
         </directories>
         <excludes>
              <exclude>src/main/webapp/hackyScript.js</exclude>
              <exclude>src/main/webapp/myDirectoryForThirdyPartyStuff</exclude>
         </excludes>
         <reporter>jslint</reporter>
         <reportFile>target/jshint.xml</reportFile>
         <failOnError>false</failOnError>
     </configuration>
</plugin>

Example of configFile contents, equivalent to the XML configuration above:

{
  // Options
  "maxparams": 3,
  "indent": true,
  "camelcase": true,
  "eqeqeq": true,
  "forin": true,
  "immed": true,
  "latedef": true,
  "noarg": true,
  "noempty": true,
  "nonew": true,
  /*
   * Globals
   */
  "globals": { 
     "require": false,
     "$": false,
     "yourFunkyJavascriptModule": false
  }
}

jshint-mojo's People

Contributors

stupenrose avatar ringel7 avatar markw avatar crydust avatar voelzmo avatar finalfantasia avatar afsmith92 avatar darkone23 avatar buggyvelarde avatar gvamos avatar oohira avatar thorin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.