8000 Update eslint config · HowProgrammingWorks/CommandLine@b726eff · GitHub
[go: up one dir, main page]

Skip to content

Commit b726eff

Browse files
committed
Update eslint config
1 parent b93865c commit b726eff

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

.eslintrc.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
"rules": {
1212
"indent": [
1313
"error",
14-
2,
15-
{ "SwitchCase": 1 }
14+
2
1615
],
1716
"linebreak-style": [
1817
"error",
@@ -114,6 +113,9 @@
114113
"new-parens": [
115114
"error"
116115
],
116+
"no-lonely-if": [
117+
"error"
118+
],
117119
"no-trailing-spaces": [
118120
"error"
119121
],
@@ -209,7 +211,7 @@
209211
],
210212
"arrow-parens": [
211213
"error",
212-
"as-needed"
214+
"always"
213215
],
214216
"arrow-body-style": [
215217
"error",
@@ -261,4 +263,4 @@
261263
"never"
262264
]
263265
}
264-
}
266+
}

JavaScript/2-readline.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const rl = readline.createInterface({
77
output: process.stdout
88
});
99

10-
rl.question('Enter your name: ', name => {
10+
rl.question('Enter your name: ', (name) => {
1111
console.log(`Hello, ${name}!`);
1212
rl.close();
1313
});

JavaScript/3-prompt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const commands = {
2222
}
2323
};
2424

25-
rl.on('line', line => {
25+
rl.on('line', (line) => {
2626
line = line.trim();
2727
const command = commands[line];
2828
if (command) command();

JavaScript/7-login.js

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

3-
const write = s => process.stdout.write(s);
3+
const write = (s) => process.stdout.write(s);
44

55
let login = '';
66
let password = '';
77

8-
process.stdin.on('data', chunk => {
8+
process.stdin.on('data', (chunk) => {
99
if (!login) {
1010
login = chunk.toString().trim();
1111
write('\x1b[13;34H');

JavaScript/8-utils.js

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

33
// Utilities
44

5-
const write = s => process.stdout.write(s);
6-
const read = callback => process.stdin.on('data', chunk => {
5+
const write = (s) => process.stdout.write(s);
6+
const read = (callback) => process.stdin.on('data', (chunk) => {
77
callback(chunk.toString().trim());
88
});
99
const clear = () => write('\x1Bc');
@@ -24,7 +24,7 @@ const box = (row, col, height, width) => {
2424

2525
// Uasage
2626

27-
read(s => {
27+
read((s) => {
2828
write(`\nHello, ${s}!\n`);
2929
process.exit(0);
3030
});

JavaScript/9-raw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
process.stdin.setRawMode(true);
44

5-
process.stdin.on('data', data => {
5+
process.stdin.on('data', (data) => {
66
const key = data[0];
77
console.dir(data);
88
if (key === 3) {

0 commit comments

Comments
 (0)
0