Created
December 2, 2014 00:48
-
-
Save johno/2e1607a61e3df36e7c85 to your computer and use it in GitHub Desktop.
CSS Linting addon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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