Skip to content

Commit

Permalink
Merge pull request #13 from billybonks/bug-fix/css-syntax
Browse files Browse the repository at this point in the history
config.syntax should be '' if css
  • Loading branch information
billybonks committed Sep 26, 2016
2 parents d0da425 + cdafd27 commit f5ef9cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function StyleLinter(inputNodes, options) {
}
this.linterConfig.files = null;

this.setSyntax(this.linterConfig.syntax);
this.setSyntax(this.linterConfig);

Filter.call(this, inputNodes, options);
}
Expand All @@ -70,7 +70,8 @@ function StyleLinter(inputNodes, options) {
* Sets the, file extensions that the broccoli plugin must parse
* @param {string} syntax sass|css|less|sugarss
*/
StyleLinter.prototype.setSyntax = function(syntax) {
StyleLinter.prototype.setSyntax = function(config) {
var syntax = config.syntax;
var extensions = [];
var targetExtension;
if(!syntax)
Expand All @@ -81,6 +82,9 @@ StyleLinter.prototype.setSyntax = function(syntax) {
} else {
targetExtension = syntax;
}
if(syntax === 'css'){
config.syntax = "";
}
extensions.push(targetExtension);
if(this.testPassingFiles || this.testFailingFiles)
targetExtension = 'stylelint-test.js';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "broccoli-stylelint",
"version": "0.8.2",
"version": "0.8.3",
"description": "Broccoli stylelint plugin",
"keywords": [
"broccoli",
Expand Down
2 changes: 1 addition & 1 deletion tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('Broccoli StyleLint Plugin', function() {
})

it('should not log when log=false', function(){
return buildAndLint('tests/fixtures/test-plugin', {log: false,console: fakeConsole}).then(function(results){
return buildAndLint('tests/fixtures//has-errors', {log: false,console: fakeConsole}).then(function(results){
expect(fakeConsole.log).to.not.have.been.called();
});
})
Expand Down

0 comments on commit f5ef9cd

Please sign in to comment.