broccoli-swiffer

0.1.1 • Public • Published

broccoli-swiffer

A Broccoli plugin which uses swiffer to lint Dust templates.

How to install?

$ npm install broccoli-swiffer --save-dev

How to use?

In your Brocfile.js:

var dustLint = require('broccoli-swiffer');
var outputTree = dustLint(inputTree, options);

Options

  • extensions: An array of file extensions to process, default ['tl', 'dust'].
  • throwOnError: {boolean} cause exception error if linting fails
  • rules: {Object} the rules that .swifferrc would contain
var dustLint = require('broccoli-swiffer');
var outputTree = dustLint(inputTree, {
    extensions: ['dustjs'] // look for files.dustjs instead
    rules: [{
      name: 'it is a trap',
      description: 'stop using @bar',
      target: {
        type: '@',
        matches: 'bar'
      }
    }],
    // fail on lint error, but not in prod
    throwOnError: someAppThing.isProd ? false : true
});

Package Sidebar

Install

npm i broccoli-swiffer

Weekly Downloads

2

Version

0.1.1

License

Apache-2.0

Last publish

Collaborators

  • jimmyhchan