Skip to content

Commit 011fa27

Browse files
committed
[eslint] fix array bracket spacing
1 parent ceca8d5 commit 011fa27

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"rules": {
1313
"array-bracket-newline": "off",
14-
"array-bracket-spacing": "off",
14+
"array-bracket-spacing": ["error", "never"],
1515
"complexity": "off",
1616
"func-style": ["error", "declaration"],
1717
"no-magic-numbers": "off",

example/array.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ test('array', function (t) {
77
t.plan(5);
88

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

1515
var output = falafel(src, function (node) {
@@ -22,7 +22,7 @@ test('array', function (t) {
2222
[3, 4],
2323
[1, 2, [3, 4]],
2424
[5, 6],
25-
[[ 1, 2, [3, 4]], [5, 6]]
25+
[[1, 2, [3, 4]], [5, 6]]
2626
];
2727

2828
Function('fn', 'g', String(output))(
@@ -31,7 +31,7 @@ test('array', function (t) {
3131
return xs;
3232
},
3333
function (xs) {
34-
t.same(xs, [ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]);
34+
t.same(xs, [[1, 2, [3, 4]], [5, 6]]);
3535
}
3636
);
3737
});

example/fail.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ test('array', function (t) {
77
t.plan(5);
88

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

1515
var output = falafel(src, function (node) {
@@ -19,10 +19,10 @@ test('array', function (t) {
1919
});
2020

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

2828
Function('fn', 'g', String(output))(
@@ -31,7 +31,7 @@ test('array', function (t) {
3131
return xs;
3232
},
3333
function (xs) {
34-
t.same(xs, [ [ 1, 2, [ 3, 4444 ] ], [ 5, 6 ] ]);
34+
t.same(xs, [[1, 2, [3, 4444]], [5, 6]]);
3535
}
3636
);
3737
});

example/nested.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test('nested array test', function (t) {
99
var src = '(' + function () {
1010
var xs = [1, 2, [3, 4]];
1111
var ys = [5, 6];
12-
g([ xs, ys ]);
12+
g([xs, ys]);
1313
} + ')()';
1414

1515
var output = falafel(src, function (node) {

example/nested_fail.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ test('nested array test', function (t) {
77
t.plan(5);
88

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

1515
var output = falafel(src, function (node) {
@@ -28,10 +28,10 @@ test('nested array test', function (t) {
2828
});
2929

3030
var arrays = [
31-
[ 3, 4 ],
32-
[ 1, 2, [ 3, 4 ] ],
33-
[ 5, 6 ],
34-
[ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]
31+
[3, 4],
32+
[1, 2, [3, 4]],
33+
[5, 6],
34+
[[1, 2, [3, 4]], [5, 6]]
3535
];
3636

3737
Function('fn', 'g', String(output))(
@@ -40,7 +40,7 @@ test('nested array test', function (t) {
4040
return xs;
4141
},
4242
function (xs) {
43-
t.same(xs, [ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ]);
43+
t.same(xs, [[1, 2, [3, 4]], [5, 6]]);
4444
}
4545
);
4646
});

example/too_many_fail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test('array', function (t) {
99
var src = '(' + function () {
1010
var xs = [1, 2, [3, 4]];
1111
var ys = [5, 6];
12-
g([ xs, ys ]);
12+
g([xs, ys]);
1313
} + ')()';
1414

1515
var output = falafel(src, function (node) {

0 commit comments

Comments
 (0)