Skip to content

Commit ee63fa8

Browse files
committed
Simplify lintImportedFiles by removing extra function
Not sure why this was being done, as it can be handled with a simple function call and doesn't need a closure to store `merged`
1 parent 2eca628 commit ee63fa8

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

lib/index.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function mergeOptions(options) {
9999
if (typeof beforeLint === 'function') {
100100
css = beforeLint(css, filename, merged);
101101
}
102-
return lintImportedFiles(merged)(css, filename);
102+
return lintImportedFiles(merged, css, filename);
103103
};
104104

105105
// Allow additional plugins to be merged with the defaults
@@ -119,18 +119,16 @@ function mergeOptions(options) {
119119
* @param {Object} options
120120
* @returns {Function} Used by postcss-import transform
121121
*/
122-
function lintImportedFiles(options) {
123-
return function(css, filename) {
124-
var processor = postcss();
122+
function lintImportedFiles(options, css, filename) {
123+
var processor = postcss();
125124

126-
if (options.lint) {
127-
processor.use(stylelint(options.stylelint));
128-
}
125+
if (options.lint) {
126+
processor.use(stylelint(options.stylelint));
127+
}
129128

130-
processor
131-
.use(bemLinter(options['postcss-bem-linter']))
132-
.use(reporter(options['postcss-reporter']));
129+
processor
130+
.use(bemLinter(options['postcss-bem-linter']))
131+
.use(reporter(options['postcss-reporter']));
133132

134-
return processor.process(css, {from: filename}).css;
135-
};
133+
return processor.process(css, {from: filename}).css;
136134
}

0 commit comments

Comments
 (0)