Skip to content

Commit

Permalink
Merge pull request #2533 from seven-phases-max/fix-formatting-for-jscs
Browse files Browse the repository at this point in the history
Fix formatting to meet jscs settings
  • Loading branch information
lukeapage committed Apr 1, 2015
2 parents 1e67f03 + 1950248 commit fc93876
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 40 deletions.
5 changes: 3 additions & 2 deletions lib/less-rhino/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*jshint rhino:true, unused: false */
/*global name:true, less, loadStyleSheet, os */
/* jshint rhino:true, unused: false */
/* jscs:disable validateIndentation */
/* global name:true, less, loadStyleSheet, os */

function formatError(ctx, options) {
options = options || {};
Expand Down
3 changes: 1 addition & 2 deletions lib/less/parser/parser-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ module.exports = function() {
currentPos = parserInput.i;

if (!current.length) {
if (j < chunks.length - 1)
{
if (j < chunks.length - 1) {
current = chunks[++j];
skipWhitespace(0); // skip space at the beginning of a chunk
return true; // things changed
Expand Down
9 changes: 3 additions & 6 deletions lib/less/parser/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ var Parser = function Parser(context, imports, fileInfo) {
primary: function () {
var mixin = this.mixin, root = [], node;

while (true)
{
while (true) {
while (true) {
node = this.comment();
if (!node) { break; }
Expand Down Expand Up @@ -1207,8 +1206,7 @@ var Parser = function Parser(context, imports, fileInfo) {
features = features && new(tree.Value)(features);
return new(tree.Import)(path, features, options, index, fileInfo);
}
else
{
else {
parserInput.i = index;
error("malformed import statement");
}
Expand Down Expand Up @@ -1360,8 +1358,7 @@ var Parser = function Parser(context, imports, fileInfo) {

return new(tree.Import)(path, null, options, index, fileInfo);
}
else
{
else {
parserInput.i = index;
error("malformed plugin statement");
}
Expand Down
3 changes: 1 addition & 2 deletions lib/less/source-map-output.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ module.exports = function (environment) {

if (this._outputSourceFiles) {
for (var filename in this._contentsMap) {
if (this._contentsMap.hasOwnProperty(filename))
{
if (this._contentsMap.hasOwnProperty(filename)) {
var source = this._contentsMap[filename];
if (this._contentsIgnoredCharsMap[filename]) {
source = source.slice(this._contentsIgnoredCharsMap[filename]);
Expand Down
2 changes: 1 addition & 1 deletion lib/less/tree/dimension.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Dimension.prototype.convertTo = function (conversions) {
conversions = derivedConversions;
}
applyUnit = function (atomicUnit, denominator) {
/*jshint loopfunc:true */
/* jshint loopfunc:true */
if (group.hasOwnProperty(atomicUnit)) {
if (denominator) {
value = value / (group[atomicUnit] / group[targetUnit]);
Expand Down
3 changes: 1 addition & 2 deletions lib/less/visitors/extend-visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ ProcessExtendsVisitor.prototype = {
if (iterationCount > 100) {
var selectorOne = "{unable to calculate}";
var selectorTwo = "{unable to calculate}";
try
{
try {
selectorOne = extendsToAdd[0].selfSelectors[0].toCSS();
selectorTwo = extendsToAdd[0].selector.toCSS();
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"grunt-contrib-jasmine": "^0.8.2",
"grunt-contrib-jshint": "^0.11.0",
"grunt-contrib-uglify": "^0.8.0",
"grunt-jscs": "~1.5.0",
"grunt-jscs": "^1.6.0",
"grunt-shell": "^1.1.1",
"grunt-browserify": "~3.5.0",
"jit-grunt": "^0.9.1",
Expand Down
3 changes: 2 additions & 1 deletion test/browser/runner-global-vars-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ var less = {
errorReporting: "console",
globalVars: {
"@global-var": "red"
}};
}
};
22 changes: 11 additions & 11 deletions test/browser/runner-main-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ var less = {
};
less.strictMath = true;
less.functions = {
add: function(a, b) {
return new(less.tree.Dimension)(a.value + b.value);
},
increment: function(a) {
return new(less.tree.Dimension)(a.value + 1);
},
_color: function(str) {
if (str.value === "evil red") {
return new(less.tree.Color)("600");
}
}
add: function(a, b) {
return new(less.tree.Dimension)(a.value + b.value);
},
increment: function(a) {
return new(less.tree.Dimension)(a.value + 1);
},
_color: function(str) {
if (str.value === "evil red") {
return new(less.tree.Color)("600");
}
}
};
22 changes: 10 additions & 12 deletions test/plugins/visitor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@
};

RemoveProperty.prototype = {
isReplacing: true,
run: function (root) {
return this._visitor.visit(root);
},
visitRule: function (ruleNode, visitArgs) {
if (ruleNode.name != '-some-aribitrary-property')
{
return ruleNode;
isReplacing: true,
run: function (root) {
return this._visitor.visit(root);
},
visitRule: function (ruleNode, visitArgs) {
if (ruleNode.name != '-some-aribitrary-property') {
return ruleNode;
} else {
return [];
}
}
else {
return [];
}
}
};

exports.install = function(less, pluginManager) {
Expand Down

0 comments on commit fc93876

Please sign in to comment.