Symfony bundle that registers a JsHint assetic filter
PHP
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.
DependencyInjection
Resources/config
.gitignore
CodeLoversJsHintBundle.php
LICENSE
README.md
composer.json

README.md

JsHintBundle

This Symfony 2 Bundle registers an Assetic filter to pass JavaScript files through JsHint on compilation.

Installation

Install the bundle using composer (see http://getcomposer.org/ for more information about composer) by adding it to your composer.json file and running composer update:

    // composer.json

    "require": {
        // ...
        "codelovers/assetic-jshint": "dev-master",
        "codelovers/assetic-jshint-bundle": "dev-master"
    }

Then just add the bundle to your AppKernel.php file:

<?php
// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new CodeLovers\JsHintBundle\CodeLoversJsHintBundle(),
    // ...
);

Install JsHint

You will need to install JsHint to use this bundle. We assume you already have installed node.js:

npm install -g jshint

Configuration

All you need to configure is the path to your jshint binary. Most likely it will be /usr/bin/jshint (that's the default value of the bundle's configuration) or /usr/local/bin/jshint

code_lovers_js_hint:
    jshint_bin: ~

Usage

Simply apply the filter to your JavaScript assets:

{% javascripts
 '@AcmeDemoBundle/Resources/js/app.js'
 filter='jshint' output='compiled/js/app.js' %} ... {% endjavascripts %}