Skip to content

Commit dafd6be

Browse files
committed
Update csscomb.js to version 2.0.x
1 parent dc9f7a8 commit dafd6be

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"test": "grunt test"
3030
},
3131
"dependencies": {
32-
"csscomb": "1.0.0"
32+
"csscomb": "2.0.x"
3333
},
3434
"devDependencies": {
3535
"grunt-contrib-jshint": "~0.6.0",

tasks/csscomb.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ module.exports = function (grunt) {
1111
grunt.registerMultiTask('csscomb', 'Sorting CSS properties in specific order.', function () {
1212

1313
var Comb = require('csscomb'),
14-
defaultConfig = require('../node_modules/csscomb/.csscomb.json');
14+
comb = new Comb(),
15+
defaultConfig = comb.getConfig('csscomb');
1516

1617
// Get config file from task's options:
1718
var config = grunt.task.current.options().sortOrder;
@@ -24,11 +25,10 @@ module.exports = function (grunt) {
2425
config = defaultConfig;
2526
}
2627

27-
this.files.forEach(function (f) {
28+
// Configure csscomb:
29+
comb.configure(config);
2830

29-
// Create a new instance of csscomb and configure it:
30-
var comb = new Comb();
31-
comb.configure(config);
31+
this.files.forEach(function (f) {
3232

3333
f.src.filter(function (filepath) {
3434
// Warn on and remove invalid source files (if nonull was set).
@@ -50,4 +50,4 @@ module.exports = function (grunt) {
5050
});
5151
});
5252
});
53-
};
53+
};

0 commit comments

Comments
 (0)