Skip to content

Commit 85424c4

Browse files
committed
Lint tweaks.
1 parent ad5a006 commit 85424c4

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

lib/clean-css-processor.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
var CleanCSS = require('clean-css'),
2-
usage = require("./usage");
1+
"use strict";
32

4-
module.exports = function(less) {
3+
var CleanCSS = require("clean-css");
4+
5+
module.exports = function() {
56
function CleanCSSProcessor(options) {
67
this.options = options || {};
7-
};
8+
}
89

910
CleanCSSProcessor.prototype = {
1011
process: function (css, extra) {
@@ -24,25 +25,24 @@ module.exports = function(less) {
2425
}
2526
}
2627

27-
if (options.keepSpecialComments === undefined) {
28+
if (typeof options.keepSpecialComments === "undefined") {
2829
options.keepSpecialComments = "*";
2930
}
3031
options.processImport = false;
3132

32-
if (options.rebase === undefined) {
33+
if (typeof options.rebase === "undefined") {
3334
options.rebase = false;
3435
}
3536

36-
if (options.advanced === undefined) {
37+
if (typeof options.advanced === "undefined") {
3738
options.advanced = false;
3839
}
3940

4041
var output = new CleanCSS(options).minify(css);
4142

4243
if (sourceMap) {
4344
if (sourcesContent) {
44-
for(var source = 0; source < sources.length; source++)
45-
{
45+
for (var source = 0; source < sources.length; source++) {
4646
output.sourceMap.setSourceContent(sources[source], sourcesContent[source]);
4747
}
4848
}

lib/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
"use strict";
2+
13
var getCleanCSSProcessor = require("./clean-css-processor"),
24
usage = require("./usage"),
35
parseOptions = require("./parse-options");
46

57
function LessPluginCleanCSS(options) {
68
this.options = options;
7-
};
9+
}
810

911
LessPluginCleanCSS.prototype = {
1012
install: function(less, pluginManager) {

lib/parse-options.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
"use strict";
2+
13
module.exports = function(options) {
2-
if (typeof options === 'string') {
4+
if (typeof options === "string") {
35
var cleanOptionArgs = options.split(" ");
46
options = {};
5-
for(var i = 0; i < cleanOptionArgs.length; i++) {
7+
8+
for (var i = 0; i < cleanOptionArgs.length; i++) {
69
var argSplit = cleanOptionArgs[i].split("="),
7-
argName = argSplit[0].replace(/^-+/,"");
8-
switch(argName) {
10+
argName = argSplit[0].replace(/^-+/, "");
11+
12+
switch (argName) {
913
case "keep-line-breaks":
1014
case "b":
1115
options.keepBreaks = true;

lib/usage.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
module.exports = {
24
printUsage: function() {
35
console.log("");
@@ -14,6 +16,6 @@ module.exports = {
1416
printOptions: function() {
1517
console.log("we support the following arguments... 'keep-line-breaks', 'b'");
1618
console.log("'s0', 's1', 'advanced', 'rebase', 'keepSpecialComments', compatibility', 'rounding-precision'");
17-
console.log("'skip-aggressive-merging', 'skip-shorthand-compacting'")
19+
console.log("'skip-aggressive-merging', 'skip-shorthand-compacting'");
1820
}
1921
};

0 commit comments

Comments
 (0)