JSHint filter for Assetic
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/CodeLovers/Assetic/Filter
test
.gitignore
LICENSE
README.md
composer.json
phpunit.xml.dist

README.md

assetic-jshint

JSHint filter for Assetic

Most likely you will want to use this filter in a Symonfy 2 app. So we've created a bundle too :)

codelovers/assetic-jshint-bundle

Standalone usage

This filter will pass given assets through JsHint and throw an exception if any error has been found. To run it, you will need JsHint installed. Assuming you already have installed node.js, you can install JsHint easily:

npm install -g jshint

The filter then only needs the path to the jshint binary as it's only constructor argument. Most likely it will be /usr/bin/jshint, which is the default value, or /usr/local/bin/jshint

<?php
$filter = new JsHintFilter(); // if your jshint binary is in /usr/bin/jshint

$filter = new JsHintFilter("/path/to/jshint");