Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
handle jshinting via ember-cli's new 'lint' hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Jan 25, 2015
1 parent 64764fb commit dbd56ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

var path = require('path');
var fs = require('fs');
var jshintTrees = require('broccoli-jshint');

module.exports = {
name: 'Ember CLI QUnit',
Expand Down Expand Up @@ -70,6 +71,8 @@ module.exports = {
});
});
}

this.jshintrc = app.options.jshintrc;
},

contentFor: function(type) {
Expand All @@ -80,5 +83,16 @@ module.exports = {

_readTemplate: function(name) {
return fs.readFileSync(path.join(__dirname, 'templates', name + '.html'));
},

postprocessTree: function(type, tree) {
if (type === 'lint-app' || type === 'lint-tests' || type === 'lint-addon') {
return jshintTrees(tree, {
jshintrcPath: this.jshintrc.tests,
description: 'JSHint ' + type.slice(5) + '- QUnit'
});
} else {
return tree;
}
}
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"url": "https://github.com/jakecraige/ember-cli-qunit/issues"
},
"homepage": "https://github.com/jakecraige/ember-cli-qunit",
"dependencies": {},
"dependencies": {
"broccoli-jshint": "0.5.3"
},
"bundledDependencies": []
}

0 comments on commit dbd56ae

Please sign in to comment.