Skip to content

Commit 5387a10

Browse files
committed
Use const instead of let
1 parent 3eef3a1 commit 5387a10

File tree

5 files changed

+145
-6
lines changed

5 files changed

+145
-6
lines changed

.eslintrc.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
parserOptions:
2+
ecmaVersion: 6
3+
env:
4+
node: true
5+
extends: 'eslint:recommended'
6+
rules:
7+
indent:
8+
- error
9+
- 2
10+
- SwitchCase: 1
11+
VariableDeclarator:
12+
var: 2
13+
let: 2
14+
const: 3
15+
MemberExpression: 1
16+
linebreak-style:
17+
- error
18+
- unix
19+
quotes:
20+
- error
21+
- single
22+
semi:
23+
- error
24+
- always
25+
eqeqeq:
26+
- error
27+
- always
28+
no-loop-func:
29+
- error
30+
strict:
31+
- error
32+
- global
33+
block-spacing:
34+
- error
35+
- always
36+
brace-style:
37+
- error
38+
- 1tbs
39+
- allowSingleLine: true
40+
camelcase:
41+
- error
42+
comma-style:
43+
- error
44+
- last
45+
comma-spacing:
46+
- error
47+
- before: false
48+
after: true
49+
eol-last:
50+
- error
51+
func-call-spacing:
52+
- error
53+
- never
54+
key-spacing:
55+
- error
56+
- beforeColon: false
57+
afterColon: true
58+
mode: minimum
59+
keyword-spacing:
60+
- error
61+
- before: true
62+
after: true
63+
overrides:
64+
function:
65+
after: false
66+
max-len:
67+
- error
68+
- code: 80
69+
ignoreUrls: true
70+
max-nested-callbacks:
71+
- error
72+
- max: 5
73+
new-cap:
74+
- error
75+
- newIsCap: true
76+
capIsNew: true
77+
properties: true
78+
new-parens:
79+
- error
80+
no-lonely-if:
81+
- error
82+
no-trailing-spaces:
83+
- error
84+
no-unneeded-ternary:
85+
- error
86+
no-whitespace-before-property:
87+
- error
88+
object-curly-spacing:
89+
- error
90+
- always
91+
operator-assignment:
92+
- error
93+
- always
94+
operator-linebreak:
95+
- error
96+
- after
97+
semi-spacing:
98+
- error
99+
- before: false
100+
after: true
101+
space-before-blocks:
102+
- error
103+
- always
104+
space-before-function-paren:
105+
- error
106+
- never
107+
space-in-parens:
108+
- error
109+
- never
110+
space-infix-ops:
111+
- error
112+
space-unary-ops:
113+
- error
114+
- words: true
115+
nonwords: false
116+
overrides:
117+
typeof: false
118+
no-unreachable:
119+
- error
120+
no-global-assign:
121+
- error
122+
no-self-compare:
123+
- error
124+
no-unmodified-loop-condition:
125+
- error
126+
no-constant-condition:
127+
- error
128+
- checkLoops: false
129+
no-console:
130+
- off
131+
no-useless-concat:
132+
- error
133+
no-useless-escape:
134+
- error
135+
no-shadow-restricted-names:
136+
- error
137+
no-use-before-define:
138+
- error
139+
- functions: false

JavaScript/4-for-in.js

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

3-
let arr = [7, 10, 1, 5, 2];
3+
const arr = [7, 10, 1, 5, 2];
44
arr.field = 'Value';
55

66
for (let i in arr) {
7-
console.log(i);
7+
console.log(i);
88
}

JavaScript/5-for-of.js

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

3-
let arr = [7, 10, 1, 5, 2];
3+
const arr = [7, 10, 1, 5, 2];
44
arr.field = 'Value';
55

66
for (let i of arr) {
7-
console.log(i);
7+
console.log(i);
88
}

JavaScript/8-forEach.js

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

3-
let a = [7, 10, 1, 5, 2];
3+
const a = [7, 10, 1, 5, 2];
44

55
a.forEach(function(item, i, arr) {
66
console.log(i, arr, item);

JavaScript/9-map.js

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

3-
let log = s => console.log(s);
3+
const log = s => console.log(s);
44

55
[7, 10, 1, 5, 2].map(x => x * 2).map(log);

0 commit comments

Comments
 (0)