Skip to content

Commit ad4198f

Browse files
committed
Change eslint rule arrow-parens to always
1 parent 7ea2ac2 commit ad4198f

13 files changed

Lines changed: 22 additions & 22 deletions

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
],
214214
"arrow-parens": [
215215
"error",
216-
"as-needed"
216+
"always"
217217
],
218218
"arrow-body-style": [
219219
"error",

Exercises/1-seq.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
22

3-
const seq = f => g => x => 0;
3+
const seq = (f) => (g) => (x) => 0;
44

55
module.exports = { seq };

JavaScript/3-closure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const add = x => y => {
3+
const add = (x) => (y) => {
44
const z = x + y;
55
console.log(x + '+' + y + '=' + z);
66
return z;

JavaScript/4-closure-recursive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const add = x => y => {
3+
const add = (x) => (y) => {
44
const z = x + y;
55
console.log(x + '+' + y + '=' + z);
66
return add(z);

JavaScript/5-logger.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
const logger = kind => {
3+
const logger = (kind) => {
44
const color = logger.colors[kind] || logger.colors.info;
5-
return s => {
5+
return (s) => {
66
const date = new Date().toISOString();
77
console.log(color + date + '\t' + s);
88
};

JavaScript/6-functor.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'use strict';
22

3-
const add = x => {
4-
const f = y => {
3+
const add = (x) => {
4+
const f = (y) => {
55
const z = x + y;
66
console.log(x + '+' + y + '=' + z);
77
return add(z);
88
};
9-
f.map = fn => fn(x);
9+
f.map = (fn) => fn(x);
1010
return f;
1111
};
1212

@@ -21,4 +21,4 @@ console.log('a3 sum is:');
2121
a3.map(console.log);
2222

2323
console.log('\nAll functors:');
24-
[a1, a2, a3, a4, a5].map(fn => fn.map(console.log));
24+
[a1, a2, a3, a4, a5].map((fn) => fn.map(console.log));

JavaScript/7-functor-short.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
const add = x => {
4-
const f = y => add(x + y);
5-
f.map = fn => fn(x);
3+
const add = (x) => {
4+
const f = (y) => add(x + y);
5+
f.map = (fn) => fn(x);
66
return f;
77
};
88

JavaScript/8-adder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
const adder = a => {
3+
const adder = (a) => {
44
const value = () => a;
5-
const add = b => adder(a + b);
5+
const add = (b) => adder(a + b);
66
return { add, value };
77
};
88

JavaScript/9-adder-methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const adder = a => ({
3+
const adder = (a) => ({
44
value() {
55
return a;
66
},

JavaScript/a-adder-line.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const adder = a => ({ value: () => a, add: b => adder(a + b) });
3+
const adder = (a) => ({ value: () => a, add: (b) => adder(a + b) });
44

55
// Usage
66

0 commit comments

Comments
 (0)