Skip to content

Commit b035590

Browse files
committed
[eslint] fix indentation
1 parent 85d86a4 commit b035590

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+4738
-4739
lines changed

.eslintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"array-bracket-spacing": "off",
1414
"complexity": "off",
1515
"func-style": "warn",
16-
"indent": ["error", 4],
1716
"max-lines-per-function": "warn",
1817
"max-lines": "warn",
1918
"max-statements-per-line": [2, { "max": 2 }],

bin/tape

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,64 +5,64 @@
55
var parseOpts = require('minimist');
66

77
var opts = parseOpts(process.argv.slice(2), {
8-
alias: { r: 'require', i: 'ignore' },
9-
string: ['require', 'ignore'],
10-
boolean: ['only'],
11-
default: { r: [], i: null, only: null }
8+
alias: { r: 'require', i: 'ignore' },
9+
string: ['require', 'ignore'],
10+
boolean: ['only'],
11+
default: { r: [], i: null, only: null }
1212
});
1313

1414
if (typeof opts.only === 'boolean') {
15-
process.env.NODE_TAPE_NO_ONLY_TEST = !opts.only;
15+
process.env.NODE_TAPE_NO_ONLY_TEST = !opts.only;
1616
}
1717

1818
var cwd = process.cwd();
1919

2020
if (typeof opts.require === 'string') {
21-
opts.require = [opts.require];
21+
opts.require = [opts.require];
2222
}
2323

2424
var resolveModule;
2525
opts.require.forEach(function (module) {
26-
if (module) {
27-
if (!resolveModule) { resolveModule = require('resolve').sync; }
28-
// This check ensures we ignore `-r ""`, trailing `-r`, or other silly things the user might (inadvertently) be doing.
29-
require(resolveModule(module, { basedir: cwd }));
30-
}
26+
if (module) {
27+
if (!resolveModule) { resolveModule = require('resolve').sync; }
28+
// This check ensures we ignore `-r ""`, trailing `-r`, or other silly things the user might (inadvertently) be doing.
29+
require(resolveModule(module, { basedir: cwd }));
30+
}
3131
});
3232

3333
var resolvePath = require('path').resolve;
3434

3535
var matcher;
3636
if (typeof opts.ignore === 'string') {
37-
var readFileSync = require('fs').readFileSync;
38-
try {
39-
var ignoreStr = readFileSync(resolvePath(cwd, opts.ignore || '.gitignore'), 'utf-8');
40-
} catch (e) {
41-
console.error(e.message);
42-
process.exit(2);
43-
}
44-
var ignore = require('dotignore');
45-
matcher = ignore.createMatcher(ignoreStr);
37+
var readFileSync = require('fs').readFileSync;
38+
try {
39+
var ignoreStr = readFileSync(resolvePath(cwd, opts.ignore || '.gitignore'), 'utf-8');
40+
} catch (e) {
41+
console.error(e.message);
42+
process.exit(2);
43+
}
44+
var ignore = require('dotignore');
45+
matcher = ignore.createMatcher(ignoreStr);
4646
}
4747

4848
var glob = require('glob');
4949

5050
opts._.reduce(function (result, arg) {
51-
if (glob.hasMagic(arg)) {
52-
// If glob does not match, `files` will be an empty array. Note: `glob.sync` may throw an error and crash the node process.
53-
var files = glob.sync(arg);
51+
if (glob.hasMagic(arg)) {
52+
// If glob does not match, `files` will be an empty array. Note: `glob.sync` may throw an error and crash the node process.
53+
var files = glob.sync(arg);
5454

55-
if (!Array.isArray(files)) {
56-
throw new TypeError('unknown error: glob.sync did not return an array or throw. Please report this.');
57-
}
55+
if (!Array.isArray(files)) {
56+
throw new TypeError('unknown error: glob.sync did not return an array or throw. Please report this.');
57+
}
5858

59-
return result.concat(files);
60-
}
61-
return result.concat(arg);
59+
return result.concat(files);
60+
}
61+
return result.concat(arg);
6262
}, []).filter(function (file) {
63-
return !matcher || !matcher.shouldIgnore(file);
63+
return !matcher || !matcher.shouldIgnore(file);
6464
}).forEach(function (file) {
65-
require(resolvePath(cwd, file));
65+
require(resolvePath(cwd, file));
6666
});
6767

6868
// vim: ft=javascript

example/array.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@ var falafel = require('falafel');
44
var test = require('../');
55

66
test('array', function (t) {
7-
t.plan(5);
7+
t.plan(5);
88

9-
var src = '(' + function () {
10-
var xs = [ 1, 2, [ 3, 4 ] ];
11-
var ys = [ 5, 6 ];
12-
g([ xs, ys ]);
13-
} + ')()';
9+
var src = '(' + function () {
10+
var xs = [ 1, 2, [ 3, 4 ] ];
11+
var ys = [ 5, 6 ];
12+
g([ xs, ys ]);
13+
} + ')()';
1414

15-
var output = falafel(src, function (node) {
16-
if (node.type === 'ArrayExpression') {
17-
node.update('fn(' + node.source() + ')');
18-
}
19-
});
15+
var output = falafel(src, function (node) {
16+
if (node.type === 'ArrayExpression') {
17+
node.update('fn(' + node.source() + ')');
18+
}
19+
});
2020

21-
var arrays = [
22-
[3, 4],
23-
[1, 2, [3, 4]],
24-
[5, 6],
25-
[[ 1, 2, [3, 4]], [5, 6]]
26-
];
21+
var arrays = [
22+
[3, 4],
23+
[1, 2, [3, 4]],
24+
[5, 6],
25+
[[ 1, 2, [3, 4]], [5, 6]]
26+
];
2727

28-
Function(['fn', 'g'], output)(
29-
function (xs) {
30-
t.same(arrays.shift(), xs);
31-
return xs;
32-
},
33-
function (xs) {
34-
t.same(xs, [ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]);
35-
}
36-
);
28+
Function(['fn', 'g'], output)(
29+
function (xs) {
30+
t.same(arrays.shift(), xs);
31+
return xs;
32+
},
33+
function (xs) {
34+
t.same(xs, [ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]);
35+
}
36+
);
3737
});

example/fail.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@ var falafel = require('falafel');
44
var test = require('../');
55

66
test('array', function (t) {
7-
t.plan(5);
7+
t.plan(5);
88

9-
var src = '(' + function () {
10-
var xs = [ 1, 2, [ 3, 4 ] ];
11-
var ys = [ 5, 6 ];
12-
g([ xs, ys ]);
13-
} + ')()';
9+
var src = '(' + function () {
10+
var xs = [ 1, 2, [ 3, 4 ] ];
11+
var ys = [ 5, 6 ];
12+
g([ xs, ys ]);
13+
} + ')()';
1414

15-
var output = falafel(src, function (node) {
16-
if (node.type === 'ArrayExpression') {
17-
node.update('fn(' + node.source() + ')');
18-
}
19-
});
15+
var output = falafel(src, function (node) {
16+
if (node.type === 'ArrayExpression') {
17+
node.update('fn(' + node.source() + ')');
18+
}
19+
});
2020

21-
var arrays = [
22-
[ 3, 4 ],
23-
[ 1, 2, [ 3, 4 ] ],
24-
[ 5, 6 ],
25-
[ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]
26-
];
21+
var arrays = [
22+
[ 3, 4 ],
23+
[ 1, 2, [ 3, 4 ] ],
24+
[ 5, 6 ],
25+
[ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]
26+
];
2727

28-
Function(['fn', 'g'], output)(
29-
function (xs) {
30-
t.same(arrays.shift(), xs);
31-
return xs;
32-
},
33-
function (xs) {
34-
t.same(xs, [ [ 1, 2, [ 3, 4444 ] ], [ 5, 6 ] ]);
35-
}
36-
);
28+
Function(['fn', 'g'], output)(
29+
function (xs) {
30+
t.same(arrays.shift(), xs);
31+
return xs;
32+
},
33+
function (xs) {
34+
t.same(xs, [ [ 1, 2, [ 3, 4444 ] ], [ 5, 6 ] ]);
35+
}
36+
);
3737
});

example/nested.js

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,50 @@ var falafel = require('falafel');
44
var test = require('../');
55

66
test('nested array test', function (t) {
7-
t.plan(5);
8-
9-
var src = '(' + function () {
10-
var xs = [1, 2, [3, 4]];
11-
var ys = [5, 6];
12-
g([ xs, ys ]);
13-
} + ')()';
14-
15-
var output = falafel(src, function (node) {
16-
if (node.type === 'ArrayExpression') {
17-
node.update('fn(' + node.source() + ')');
18-
}
19-
});
20-
21-
t.test('inside test', function (q) {
22-
q.plan(2);
23-
q.ok(true, 'inside ok');
24-
25-
setTimeout(function () {
26-
q.ok(true, 'inside delayed');
27-
}, 3000);
28-
});
29-
30-
var arrays = [
31-
[3, 4],
32-
[1, 2, [3, 4]],
33-
[5, 6],
34-
[[ 1, 2, [3, 4]], [5, 6]]
35-
];
36-
37-
Function(['fn', 'g'], output)(
38-
function (xs) {
39-
t.same(arrays.shift(), xs);
40-
return xs;
41-
},
42-
function (xs) {
43-
t.same(xs, [[1, 2, [3, 4]], [5, 6]]);
44-
}
45-
);
7+
t.plan(5);
8+
9+
var src = '(' + function () {
10+
var xs = [1, 2, [3, 4]];
11+
var ys = [5, 6];
12+
g([ xs, ys ]);
13+
} + ')()';
14+
15+
var output = falafel(src, function (node) {
16+
if (node.type === 'ArrayExpression') {
17+
node.update('fn(' + node.source() + ')');
18+
}
19+
});
20+
21+
t.test('inside test', function (q) {
22+
q.plan(2);
23+
q.ok(true, 'inside ok');
24+
25+
setTimeout(function () {
26+
q.ok(true, 'inside delayed');
27+
}, 3000);
28+
});
29+
30+
var arrays = [
31+
[3, 4],
32+
[1, 2, [3, 4]],
33+
[5, 6],
34+
[[ 1, 2, [3, 4]], [5, 6]]
35+
];
36+
37+
Function(['fn', 'g'], output)(
38+
function (xs) {
39+
t.same(arrays.shift(), xs);
40+
return xs;
41+
},
42+
function (xs) {
43+
t.same(xs, [[1, 2, [3, 4]], [5, 6]]);
44+
}
45+
);
4646
});
4747

4848
test('another', function (t) {
49-
t.plan(1);
50-
setTimeout(function () {
51-
t.ok(true);
52-
}, 100);
49+
t.plan(1);
50+
setTimeout(function () {
51+
t.ok(true);
52+
}, 100);
5353
});

0 commit comments

Comments
 (0)