Domanda

I am running JSHint as part of the Checkstyle plugin for Jenkins. So far, this works good, but there is one issue. I call JSHint using:

jshint --verbose --reporter=checkstyle foo > checkstyle-jshint.xml || exit 0

and this works, but it automatically runs JSHint using the --show-non-errors option - which is definitely not what I want. I have seen that this is an official JSHint issue, hence it seems wrong on the one hand, but (at the moment) official behavior of JSHint.

Does anybody have an idea of how to workaround this, so that the Checkstyle report only inlcudes the errors JSHint would report on the console when running it without the --show-non-errors parameter?

È stato utile?

Soluzione

Okay, I found a workaround myself: Using the --reporter parameter, besides using the pre-defined values jslint and checkstyle you can also specify a .js file which implements a custom reporter.

So what I did was basically write my own custom reporter that outputs a valid checkstyle-conform .xml file. This way it works as expected.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top