Skip to content

Commit 9439851

Browse files
authored
Added indent rule (#390)
1 parent e762eee commit 9439851

File tree

5 files changed

+51
-51
lines changed

5 files changed

+51
-51
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module.exports = {
2626
"func-names": "off",
2727
"global-require": "off",
2828
"guard-for-in": "off",
29-
"indent": "off",
29+
"indent": ["error", 2],
3030
"import/no-extraneous-dependencies": "off",
3131
"import/no-unresolved": "off",
3232
"import/newline-after-import": "off",

lib/utils/index.js

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,14 @@ function build_eager(transformations) {
338338
*/
339339
function build_custom_headers(headers) {
340340
switch (true) {
341-
case headers == null:
342-
return void 0;
343-
case isArray(headers):
344-
return headers.join("\n");
345-
case isObject(headers):
346-
return entries(headers).map(([k, v]) => `${k}:${v}`).join("\n");
347-
default:
348-
return headers;
341+
case headers == null:
342+
return void 0;
343+
case isArray(headers):
344+
return headers.join("\n");
345+
case isObject(headers):
346+
return entries(headers).map(([k, v]) => `${k}:${v}`).join("\n");
347+
default:
348+
return headers;
349349
}
350350
}
351351

@@ -1100,15 +1100,15 @@ const OFFSET_ANY_PATTERN_RE = RegExp(`(${OFFSET_ANY_PATTERN})\\.\\.(${OFFSET_ANY
11001100
// Split a range into the start and end values
11011101
function split_range(range) { // :nodoc:
11021102
switch (range.constructor) {
1103-
case String:
1104-
if (!OFFSET_ANY_PATTERN_RE.test(range)) {
1105-
return range;
1106-
}
1107-
return range.split("..");
1108-
case Array:
1109-
return [first(range), last(range)];
1110-
default:
1111-
return [null, null];
1103+
case String:
1104+
if (!OFFSET_ANY_PATTERN_RE.test(range)) {
1105+
return range;
1106+
}
1107+
return range.split("..");
1108+
case Array:
1109+
return [first(range), last(range)];
1110+
default:
1111+
return [null, null];
11121112
}
11131113
}
11141114

@@ -1131,23 +1131,23 @@ function norm_range_value(value) { // :nodoc:
11311131
*/
11321132
function process_video_params(param) {
11331133
switch (param.constructor) {
1134-
case Object: {
1135-
let video = "";
1136-
if ('codec' in param) {
1137-
video = param.codec;
1138-
if ('profile' in param) {
1139-
video += ":" + param.profile;
1140-
if ('level' in param) {
1141-
video += ":" + param.level;
1142-
}
1134+
case Object: {
1135+
let video = "";
1136+
if ('codec' in param) {
1137+
video = param.codec;
1138+
if ('profile' in param) {
1139+
video += ":" + param.profile;
1140+
if ('level' in param) {
1141+
video += ":" + param.level;
11431142
}
11441143
}
1145-
return video;
11461144
}
1147-
case String:
1148-
return param;
1149-
default:
1150-
return null;
1145+
return video;
1146+
}
1147+
case String:
1148+
return param;
1149+
default:
1150+
return null;
11511151
}
11521152
}
11531153
/**

lib/utils/parsing/toArray.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ const isArray = require('lodash/isArray');
77
*/
88
function toArray(arg) {
99
switch (true) {
10-
case arg == null:
11-
return [];
12-
case isArray(arg):
13-
return arg;
14-
default:
15-
return [arg];
10+
case arg == null:
11+
return [];
12+
case isArray(arg):
13+
return arg;
14+
default:
15+
return [arg];
1616
}
1717
}
1818

test/api_spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,10 @@ describe("api", function () {
231231
({ public_id }) => cloudinary.v2.api.resources({ type: "upload" })
232232
.then(result => [public_id, result])
233233
.then(([public_id, result]) => {
234-
let resource = findByAttr(result.resources, "public_id", public_id);
235-
expect(resource).to.be.an(Object);
236-
expect(resource.type).to.eql("upload");
237-
}));
234+
let resource = findByAttr(result.resources, "public_id", public_id);
235+
expect(resource).to.be.an(Object);
236+
expect(resource.type).to.eql("upload");
237+
}));
238238
});
239239
it("should allow listing resources by prefix", function () {
240240
this.timeout(TIMEOUT.MEDIUM);

test/spechelper.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ const allExamples = {};
6363

6464
function sharedExamples(name, examples) {
6565
switch (true) {
66-
case isFunction(examples):
67-
allExamples[name] = examples;
68-
return examples;
69-
case allExamples.hasOwnProperty(name):
70-
return allExamples[name];
71-
default:
72-
return function () {
73-
console.log(`Shared example ${name} was not found!`);
74-
};
66+
case isFunction(examples):
67+
allExamples[name] = examples;
68+
return examples;
69+
case allExamples.hasOwnProperty(name):
70+
return allExamples[name];
71+
default:
72+
return function () {
73+
console.log(`Shared example ${name} was not found!`);
74+
};
7575
}
7676
}
7777

0 commit comments

Comments
 (0)