Skip to content

Instantly share code, notes, and snippets.

@johno
Created December 2, 2014 00:48
Show Gist options
  • Save johno/2e1607a61e3df36e7c85 to your computer and use it in GitHub Desktop.
Save johno/2e1607a61e3df36e7c85 to your computer and use it in GitHub Desktop.
CSS Linting addon
var csslintTree = require('broccoli-csslint');
var broccoli = require('broccoli');
'use strict';
module.exports = {
name: 'ember-cli-csslint',
included: function(app) {
this._super.included(app);
app.registry.add('css', {
name: 'ember-cli-csslint',
ext: 'css',
toTree: function(tree) {
return performCsslint(tree);
},
postProcessTree: function(tree) {
return performCsslint(tree);
}
});
}
};
// TODO: Make this less hacky since we don't need to build a new tree.
function performCsslint(tree) {
var cssTree = csslintTree('app/styles', {});
var builder = new broccoli.Builder(cssTree);
builder.build();
return tree;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment