Skip to content

Commit 6d547bd

Browse files
committed
Change eslint rule arrow-parens to always
1 parent 3a1ed2a commit 6d547bd

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
],
212212
"arrow-parens": [
213213
"error",
214-
"as-needed"
214+
"always"
215215
],
216216
"arrow-body-style": [
217217
"error",

JavaScript/4-constructor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const DAY_OF_JUDGMENT = Date.now() + Math.floor(Math.random() * 5000);
44

55
class Coming {
66
constructor() {
7-
return new Promise(resolve => setTimeout(() => {
7+
return new Promise((resolve) => setTimeout(() => {
88
resolve(this);
99
}, DAY_OF_JUDGMENT - Date.now()));
1010
}

JavaScript/5-sleep.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 sleep = msec => new Promise(resolve => {
3+
const sleep = (msec) => new Promise((resolve) => {
44
setTimeout(resolve, msec);
55
});
66

JavaScript/6-series.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22

33
// Emulate Asynchronous calls
44

5-
const pause = () => new Promise(resolve =>
5+
const pause = () => new Promise((resolve) =>
66
setTimeout(resolve, Math.floor(Math.random() * 1000))
77
);
88

99
// Asynchronous functions
1010

11-
const readConfig = async name => {
11+
const readConfig = async (name) => {
1212
await pause();
1313
console.log('(1) config loaded');
1414
return { name };
1515
};
1616

17-
const doQuery = async statement => {
17+
const doQuery = async (statement) => {
1818
await pause();
1919
console.log('(2) SQL query executed: ' + statement);
2020
return [{ name: 'Kiev' }, { name: 'Roma' }];
2121
};
2222

23-
const httpGet = async url => {
23+
const httpGet = async (url) => {
2424
await pause();
2525
console.log('(3) Page retrieved: ' + url);
2626
return '<html>Some archaic web here</html>';
2727
};
2828

29-
const readFile = async path => {
29+
const readFile = async (path) => {
3030
await pause();
3131
console.log('(4) Readme file loaded: ' + path);
3232
return 'file content';

JavaScript/7-errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { readFile } = fs.promises;
88
try {
99
const file1 = await readFile('1-prototype.js');
1010
const file2 = await readFile('2-sync')
11-
.catch(err => {
11+
.catch((err) => {
1212
console.log('Promise...catch');
1313
console.error(err);
1414
return readFile('2-sync.js');

JavaScript/9-thenable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Thenable {
2020
if (fn) {
2121
const next = fn(value);
2222
if (next) {
23-
next.then(value => {
23+
next.then((value) => {
2424
this.next.resolve(value);
2525
});
2626
}
@@ -30,7 +30,7 @@ class Thenable {
3030

3131
// Usage
3232

33-
const readFile = filename => {
33+
const readFile = (filename) => {
3434
const thenable = new Thenable();
3535
fs.readFile(filename, 'utf8', (err, data) => {
3636
if (err) throw err;

JavaScript/a-iterator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const range = {
66
[Symbol.asyncIterator]() {
77
let value = this.start;
88
return {
9-
next: () => new Promise(resolve => {
9+
next: () => new Promise((resolve) => {
1010
setTimeout(() => {
1111
resolve({
1212
value,

0 commit comments

Comments
 (0)