Skip to content

Commit a73c8e2

Browse files
committed
Update ESLint rule to require quoting numeric properties.
Flow does not allow unquoted numeric object properties, so ensure ESLint and Flow agree on this. As originally illustrated in #425
1 parent 4202306 commit a73c8e2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
"prefer-const": 2,
197197
"prefer-reflect": 0,
198198
"prefer-spread": 0,
199-
"quote-props": [2, "as-needed"],
199+
"quote-props": [2, "as-needed", {"numbers": true}],
200200
"quotes": [2, "single"],
201201
"radix": 2,
202202
"require-yield": 2,

src/__tests__/starWarsData.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ const tarkin = {
5252
};
5353

5454
const humanData = {
55-
1000: luke,
56-
1001: vader,
57-
1002: han,
58-
1003: leia,
59-
1004: tarkin,
55+
'1000': luke,
56+
'1001': vader,
57+
'1002': han,
58+
'1003': leia,
59+
'1004': tarkin,
6060
};
6161

6262
const threepio = {
@@ -76,8 +76,8 @@ const artoo = {
7676
};
7777

7878
const droidData = {
79-
2000: threepio,
80-
2001: artoo,
79+
'2000': threepio,
80+
'2001': artoo,
8181
};
8282

8383
/**

0 commit comments

Comments
 (0)