Skip to content

Commit 5e4f709

Browse files
committed
Fix linting
1 parent 345c80f commit 5e4f709

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

gulpfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ gulp.task('test', ['build'], function () {
4242
return gulp.src('build/*.js', { read: false }).pipe(mocha());
4343
});
4444

45-
gulp.task('default', ['test']);
45+
gulp.task('default', ['lint', 'test']);

index.js

+14-11
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ var loaderUtils = require('loader-utils');
22
var postcss = require('postcss');
33
var loadConfig = require('postcss-load-config');
44

5-
var postcssrc = null
5+
var postcssrc = null;
66

77
function getPostCssRc() {
88
if (!postcssrc) {
9-
postcssrc = loadConfig()
9+
postcssrc = loadConfig();
1010
}
1111

12-
return postcssrc
12+
return postcssrc;
1313
}
1414

1515
function PostCSSLoaderError(error) {
@@ -52,10 +52,10 @@ function getPluginsFromOptions(options, pack) {
5252
function loadConfigurationFromRc(callback) {
5353
getPostCssRc()
5454
.then(function (config) {
55-
callback(null, {options: config.options, plugins: config.plugins});
55+
callback(null, { options: config.options, plugins: config.plugins });
5656
})
57-
.catch(function (err) {
58-
callback(null, {options: {}, plugins: []});
57+
.catch(function () {
58+
callback(null, { options: {}, plugins: [] });
5959
});
6060
}
6161

@@ -64,15 +64,18 @@ function getConfiguration(options, pack, callback) {
6464
// only if it's not provided explicitly
6565
if ( typeof options === 'undefined' ) {
6666
if ( pack ) {
67-
callback(new Error('PostCSS plugin pack is not supported when configuration is read from file'));
67+
callback(new Error(
68+
'PostCSS plugin pack is not supported ' +
69+
'when configuration is read from file'
70+
));
6871
return;
6972
}
7073

7174
loadConfigurationFromRc(callback);
7275
return;
7376
}
7477

75-
var exec = options && options.exec
78+
var exec = options && options.exec;
7679

7780
if ( typeof options === 'function' ) {
7881
options = options.call(this, this);
@@ -87,7 +90,7 @@ function getConfiguration(options, pack, callback) {
8790
opts.syntax = options.syntax;
8891
}
8992

90-
callback(null, {options: opts, plugins: plugins, exec: exec})
93+
callback(null, { options: opts, plugins: plugins, exec: exec });
9194
}
9295

9396
module.exports = function (source, map) {
@@ -97,7 +100,7 @@ module.exports = function (source, map) {
97100
var params = loaderUtils.parseQuery(this.query);
98101

99102
var options = this.options.postcss;
100-
var pack = params.pack
103+
var pack = params.pack;
101104
var loader = this;
102105
var callback = this.async();
103106

@@ -117,7 +120,7 @@ module.exports = function (source, map) {
117120
inline: params.sourceMap === 'inline',
118121
annotation: false
119122
}
120-
})
123+
});
121124

122125
if ( typeof map === 'string' ) map = JSON.parse(map);
123126
if ( map && map.mappings ) opts.map.prev = map;

test/test_common.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ describe('common aspects', function () {
1515
});
1616

1717
it('lets other plugins alter the used plugins', function () {
18-
var css = require('!raw-loader!../?rewrite=true!./support/cases/style.css');
18+
var css = require('!raw-loader!../?rewrite=true!' +
19+
'./support/cases/style.css');
1920
expect(css).to.eql('a { color: black }\n');
2021
});
2122

@@ -34,7 +35,8 @@ describe('common aspects', function () {
3435
});
3536

3637
it('inlines map', function () {
37-
var css = require('!raw-loader!../?sourceMap=inline!./support/cases/style.css');
38+
var css = require('!raw-loader!../?sourceMap=inline!' +
39+
'./support/cases/style.css');
3840
expect(css).to.include('/*# sourceMappingURL=');
3941
});
4042

test/with-options-loader/test.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
var expect = require('chai').expect;
2-
31
describe('postcss-loader', function () {
42

53
context('when used with options loader', function () {

test/with-options/test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ describe('postcss-loader', function () {
66
require('../test_common');
77

88
it('processes CSS with custom plugins', function () {
9-
var css = require('!raw-loader!../../?pack=blues!../support/cases/style.css');
9+
var css = require('!raw-loader!../../?pack=blues!' +
10+
'../support/cases/style.css');
1011
expect(css).to.eql('a { color: blue }\n');
1112
});
12-
})
13-
13+
});
1414
});

0 commit comments

Comments
 (0)