Browse Source

Update ESLint for Code Climate (#7696)

* Update babel-eslint to version 8.2.3

* Update eslint to version 4.19.1

* Update eslint-plugin-promise to version 3.8.0

* Update eslint-plugin-react to version 7.8.2

* Upgrade eslint-plugin-jsx-a11y to version 6.0.3

* yarn test:lint --fix
Yamagishi Kazutoshi 4 months ago
parent
commit
bfa12239e8
4 changed files with 147 additions and 41 deletions
  1. 11
    1
      .eslintrc.yml
  2. 1
    1
      app/javascript/mastodon/service_worker/entry.js
  3. 5
    5
      package.json
  4. 130
    34
      yarn.lock

+ 11
- 1
.eslintrc.yml View File

@@ -113,13 +113,23 @@ rules:
113 113
   jsx-a11y/accessible-emoji: warn
114 114
   jsx-a11y/alt-text: warn
115 115
   jsx-a11y/anchor-has-content: warn
116
+  jsx-a11y/anchor-is-valid:
117
+  - warn
118
+  - components:
119
+    - Link
120
+    - NavLink
121
+    specialLink:
122
+    - to
123
+    aspect:
124
+    - noHref
125
+    - invalidHref
126
+    - preferButton
116 127
   jsx-a11y/aria-activedescendant-has-tabindex: warn
117 128
   jsx-a11y/aria-props: warn
118 129
   jsx-a11y/aria-proptypes: warn
119 130
   jsx-a11y/aria-role: warn
120 131
   jsx-a11y/aria-unsupported-elements: warn
121 132
   jsx-a11y/heading-has-content: warn
122
-  jsx-a11y/href-no-hash: warn
123 133
   jsx-a11y/html-has-lang: warn
124 134
   jsx-a11y/iframe-has-title: warn
125 135
   jsx-a11y/img-redundant-alt: warn

+ 1
- 1
app/javascript/mastodon/service_worker/entry.js View File

@@ -33,7 +33,7 @@ self.addEventListener('fetch', function(event) {
33 33
 
34 34
     event.respondWith(asyncResponse.then(
35 35
       response => asyncCache.then(cache => cache.put('/', response.clone()))
36
-                            .then(() => response),
36
+        .then(() => response),
37 37
       () => asyncCache.then(cache => cache.match('/'))));
38 38
   } else if (url.pathname === '/auth/sign_out') {
39 39
     const asyncResponse = fetch(event.request);

+ 5
- 5
package.json View File

@@ -125,14 +125,14 @@
125 125
     "whatwg-url": "^6.4.1"
126 126
   },
127 127
   "devDependencies": {
128
-    "babel-eslint": "^8.2.1",
128
+    "babel-eslint": "^8.2.3",
129 129
     "enzyme": "^3.2.0",
130 130
     "enzyme-adapter-react-16": "^1.1.0",
131
-    "eslint": "^4.15.0",
131
+    "eslint": "^4.19.1",
132 132
     "eslint-plugin-import": "^2.8.0",
133
-    "eslint-plugin-jsx-a11y": "^5.1.1",
134
-    "eslint-plugin-promise": "^3.7.0",
135
-    "eslint-plugin-react": "^7.5.1",
133
+    "eslint-plugin-jsx-a11y": "^6.0.3",
134
+    "eslint-plugin-promise": "^3.8.0",
135
+    "eslint-plugin-react": "^7.8.2",
136 136
     "jest": "^21.2.1",
137 137
     "raf": "^3.4.0",
138 138
     "react-intl-translations-manager": "^5.0.0",

+ 130
- 34
yarn.lock View File

@@ -10,6 +10,22 @@
10 10
     esutils "^2.0.2"
11 11
     js-tokens "^3.0.0"
12 12
 
13
+"@babel/code-frame@7.0.0-beta.44":
14
+  version "7.0.0-beta.44"
15
+  resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9"
16
+  dependencies:
17
+    "@babel/highlight" "7.0.0-beta.44"
18
+
19
+"@babel/generator@7.0.0-beta.44":
20
+  version "7.0.0-beta.44"
21
+  resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.0.0-beta.44.tgz#c7e67b9b5284afcf69b309b50d7d37f3e5033d42"
22
+  dependencies:
23
+    "@babel/types" "7.0.0-beta.44"
24
+    jsesc "^2.5.1"
25
+    lodash "^4.2.0"
26
+    source-map "^0.5.0"
27
+    trim-right "^1.0.1"
28
+
13 29
 "@babel/helper-function-name@7.0.0-beta.36":
14 30
   version "7.0.0-beta.36"
15 31
   resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.36.tgz#366e3bc35147721b69009f803907c4d53212e88d"
@@ -18,12 +34,40 @@
18 34
     "@babel/template" "7.0.0-beta.36"
19 35
     "@babel/types" "7.0.0-beta.36"
20 36
 
37
+"@babel/helper-function-name@7.0.0-beta.44":
38
+  version "7.0.0-beta.44"
39
+  resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz#e18552aaae2231100a6e485e03854bc3532d44dd"
40
+  dependencies:
41
+    "@babel/helper-get-function-arity" "7.0.0-beta.44"
42
+    "@babel/template" "7.0.0-beta.44"
43
+    "@babel/types" "7.0.0-beta.44"
44
+
21 45
 "@babel/helper-get-function-arity@7.0.0-beta.36":
22 46
   version "7.0.0-beta.36"
23 47
   resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.36.tgz#f5383bac9a96b274828b10d98900e84ee43e32b8"
24 48
   dependencies:
25 49
     "@babel/types" "7.0.0-beta.36"
26 50
 
51
+"@babel/helper-get-function-arity@7.0.0-beta.44":
52
+  version "7.0.0-beta.44"
53
+  resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz#d03ca6dd2b9f7b0b1e6b32c56c72836140db3a15"
54
+  dependencies:
55
+    "@babel/types" "7.0.0-beta.44"
56
+
57
+"@babel/helper-split-export-declaration@7.0.0-beta.44":
58
+  version "7.0.0-beta.44"
59
+  resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz#c0b351735e0fbcb3822c8ad8db4e583b05ebd9dc"
60
+  dependencies:
61
+    "@babel/types" "7.0.0-beta.44"
62
+
63
+"@babel/highlight@7.0.0-beta.44":
64
+  version "7.0.0-beta.44"
65
+  resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0-beta.44.tgz#18c94ce543916a80553edcdcf681890b200747d5"
66
+  dependencies:
67
+    chalk "^2.0.0"
68
+    esutils "^2.0.2"
69
+    js-tokens "^3.0.0"
70
+
27 71
 "@babel/template@7.0.0-beta.36":
28 72
   version "7.0.0-beta.36"
29 73
   resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.36.tgz#02e903de5d68bd7899bce3c5b5447e59529abb00"
@@ -33,6 +77,15 @@
33 77
     babylon "7.0.0-beta.36"
34 78
     lodash "^4.2.0"
35 79
 
80
+"@babel/template@7.0.0-beta.44":
81
+  version "7.0.0-beta.44"
82
+  resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.44.tgz#f8832f4fdcee5d59bf515e595fc5106c529b394f"
83
+  dependencies:
84
+    "@babel/code-frame" "7.0.0-beta.44"
85
+    "@babel/types" "7.0.0-beta.44"
86
+    babylon "7.0.0-beta.44"
87
+    lodash "^4.2.0"
88
+
36 89
 "@babel/traverse@7.0.0-beta.36":
37 90
   version "7.0.0-beta.36"
38 91
   resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.36.tgz#1dc6f8750e89b6b979de5fe44aa993b1a2192261"
@@ -46,6 +99,21 @@
46 99
     invariant "^2.2.0"
47 100
     lodash "^4.2.0"
48 101
 
102
+"@babel/traverse@7.0.0-beta.44":
103
+  version "7.0.0-beta.44"
104
+  resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.44.tgz#a970a2c45477ad18017e2e465a0606feee0d2966"
105
+  dependencies:
106
+    "@babel/code-frame" "7.0.0-beta.44"
107
+    "@babel/generator" "7.0.0-beta.44"
108
+    "@babel/helper-function-name" "7.0.0-beta.44"
109
+    "@babel/helper-split-export-declaration" "7.0.0-beta.44"
110
+    "@babel/types" "7.0.0-beta.44"
111
+    babylon "7.0.0-beta.44"
112
+    debug "^3.1.0"
113
+    globals "^11.1.0"
114
+    invariant "^2.2.0"
115
+    lodash "^4.2.0"
116
+
49 117
 "@babel/types@7.0.0-beta.36":
50 118
   version "7.0.0-beta.36"
51 119
   resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.36.tgz#64f2004353de42adb72f9ebb4665fc35b5499d23"
@@ -54,6 +122,14 @@
54 122
     lodash "^4.2.0"
55 123
     to-fast-properties "^2.0.0"
56 124
 
125
+"@babel/types@7.0.0-beta.44":
126
+  version "7.0.0-beta.44"
127
+  resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.44.tgz#6b1b164591f77dec0a0342aca995f2d046b3a757"
128
+  dependencies:
129
+    esutils "^2.0.2"
130
+    lodash "^4.2.0"
131
+    to-fast-properties "^2.0.0"
132
+
57 133
 "@types/node@*":
58 134
   version "8.0.53"
59 135
   resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.53.tgz#396b35af826fa66aad472c8cb7b8d5e277f4e6d8"
@@ -103,9 +179,9 @@ acorn@^5.0.0, acorn@^5.1.1:
103 179
   version "5.2.1"
104 180
   resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7"
105 181
 
106
-acorn@^5.2.1:
107
-  version "5.3.0"
108
-  resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.3.0.tgz#7446d39459c54fb49a80e6ee6478149b940ec822"
182
+acorn@^5.5.0:
183
+  version "5.6.0"
184
+  resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.6.0.tgz#572bedb377a1c61b7a289e72b8c5cfeb7baaf0bf"
109 185
 
110 186
 adjust-sourcemap-loader@^1.1.0:
111 187
   version "1.1.0"
@@ -446,7 +522,7 @@ babel-core@^6.0.0, babel-core@^6.25.0, babel-core@^6.26.0:
446 522
     slash "^1.0.0"
447 523
     source-map "^0.5.6"
448 524
 
449
-babel-eslint@^8.0.1, babel-eslint@^8.2.1:
525
+babel-eslint@^8.0.1:
450 526
   version "8.2.1"
451 527
   resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.1.tgz#136888f3c109edc65376c23ebf494f36a3e03951"
452 528
   dependencies:
@@ -457,6 +533,17 @@ babel-eslint@^8.0.1, babel-eslint@^8.2.1:
457 533
     eslint-scope "~3.7.1"
458 534
     eslint-visitor-keys "^1.0.0"
459 535
 
536
+babel-eslint@^8.2.3:
537
+  version "8.2.3"
538
+  resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.3.tgz#1a2e6681cc9bc4473c32899e59915e19cd6733cf"
539
+  dependencies:
540
+    "@babel/code-frame" "7.0.0-beta.44"
541
+    "@babel/traverse" "7.0.0-beta.44"
542
+    "@babel/types" "7.0.0-beta.44"
543
+    babylon "7.0.0-beta.44"
544
+    eslint-scope "~3.7.1"
545
+    eslint-visitor-keys "^1.0.0"
546
+
460 547
 babel-generator@^6.18.0, babel-generator@^6.26.0:
461 548
   version "6.26.0"
462 549
   resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5"
@@ -1089,6 +1176,10 @@ babylon@7.0.0-beta.36:
1089 1176
   version "7.0.0-beta.36"
1090 1177
   resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e"
1091 1178
 
1179
+babylon@7.0.0-beta.44:
1180
+  version "7.0.0-beta.44"
1181
+  resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.44.tgz#89159e15e6e30c5096e22d738d8c0af8a0e8ca1d"
1182
+
1092 1183
 babylon@^6.18.0:
1093 1184
   version "6.18.0"
1094 1185
   resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
@@ -2121,7 +2212,7 @@ doctrine@1.5.0:
2121 2212
     esutils "^2.0.2"
2122 2213
     isarray "^1.0.0"
2123 2214
 
2124
-doctrine@^2.0.0, doctrine@^2.0.2:
2215
+doctrine@^2.0.2, doctrine@^2.1.0:
2125 2216
   version "2.1.0"
2126 2217
   resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d"
2127 2218
   dependencies:
@@ -2421,9 +2512,9 @@ eslint-plugin-import@^2.8.0:
2421 2512
     minimatch "^3.0.3"
2422 2513
     read-pkg-up "^2.0.0"
2423 2514
 
2424
-eslint-plugin-jsx-a11y@^5.1.1:
2425
-  version "5.1.1"
2426
-  resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-5.1.1.tgz#5c96bb5186ca14e94db1095ff59b3e2bd94069b1"
2515
+eslint-plugin-jsx-a11y@^6.0.3:
2516
+  version "6.0.3"
2517
+  resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.0.3.tgz#54583d1ae442483162e040e13cc31865465100e5"
2427 2518
   dependencies:
2428 2519
     aria-query "^0.7.0"
2429 2520
     array-includes "^3.0.3"
@@ -2431,19 +2522,19 @@ eslint-plugin-jsx-a11y@^5.1.1:
2431 2522
     axobject-query "^0.1.0"
2432 2523
     damerau-levenshtein "^1.0.0"
2433 2524
     emoji-regex "^6.1.0"
2434
-    jsx-ast-utils "^1.4.0"
2525
+    jsx-ast-utils "^2.0.0"
2435 2526
 
2436
-eslint-plugin-promise@^3.7.0:
2437
-  version "3.7.0"
2438
-  resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.7.0.tgz#f4bde5c2c77cdd69557a8f69a24d1ad3cfc9e67e"
2527
+eslint-plugin-promise@^3.8.0:
2528
+  version "3.8.0"
2529
+  resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.8.0.tgz#65ebf27a845e3c1e9d6f6a5622ddd3801694b621"
2439 2530
 
2440
-eslint-plugin-react@^7.5.1:
2441
-  version "7.5.1"
2442
-  resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.5.1.tgz#52e56e8d80c810de158859ef07b880d2f56ee30b"
2531
+eslint-plugin-react@^7.8.2:
2532
+  version "7.8.2"
2533
+  resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.8.2.tgz#e95c9c47fece55d2303d1a67c9d01b930b88a51d"
2443 2534
   dependencies:
2444
-    doctrine "^2.0.0"
2535
+    doctrine "^2.0.2"
2445 2536
     has "^1.0.1"
2446
-    jsx-ast-utils "^2.0.0"
2537
+    jsx-ast-utils "^2.0.1"
2447 2538
     prop-types "^15.6.0"
2448 2539
 
2449 2540
 eslint-scope@^3.7.1, eslint-scope@~3.7.1:
@@ -2457,9 +2548,9 @@ eslint-visitor-keys@^1.0.0:
2457 2548
   version "1.0.0"
2458 2549
   resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
2459 2550
 
2460
-eslint@^4.15.0:
2461
-  version "4.15.0"
2462
-  resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.15.0.tgz#89ab38c12713eec3d13afac14e4a89e75ef08145"
2551
+eslint@^4.19.1:
2552
+  version "4.19.1"
2553
+  resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.19.1.tgz#32d1d653e1d90408854bfb296f076ec7e186a300"
2463 2554
   dependencies:
2464 2555
     ajv "^5.3.0"
2465 2556
     babel-code-frame "^6.22.0"
@@ -2467,10 +2558,10 @@ eslint@^4.15.0:
2467 2558
     concat-stream "^1.6.0"
2468 2559
     cross-spawn "^5.1.0"
2469 2560
     debug "^3.1.0"
2470
-    doctrine "^2.0.2"
2561
+    doctrine "^2.1.0"
2471 2562
     eslint-scope "^3.7.1"
2472 2563
     eslint-visitor-keys "^1.0.0"
2473
-    espree "^3.5.2"
2564
+    espree "^3.5.4"
2474 2565
     esquery "^1.0.0"
2475 2566
     esutils "^2.0.2"
2476 2567
     file-entry-cache "^2.0.0"
@@ -2492,18 +2583,19 @@ eslint@^4.15.0:
2492 2583
     path-is-inside "^1.0.2"
2493 2584
     pluralize "^7.0.0"
2494 2585
     progress "^2.0.0"
2586
+    regexpp "^1.0.1"
2495 2587
     require-uncached "^1.0.3"
2496 2588
     semver "^5.3.0"
2497 2589
     strip-ansi "^4.0.0"
2498 2590
     strip-json-comments "~2.0.1"
2499
-    table "^4.0.1"
2591
+    table "4.0.2"
2500 2592
     text-table "~0.2.0"
2501 2593
 
2502
-espree@^3.5.2:
2503
-  version "3.5.2"
2504
-  resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca"
2594
+espree@^3.5.4:
2595
+  version "3.5.4"
2596
+  resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7"
2505 2597
   dependencies:
2506
-    acorn "^5.2.1"
2598
+    acorn "^5.5.0"
2507 2599
     acorn-jsx "^3.0.0"
2508 2600
 
2509 2601
 esprima@^2.6.0:
@@ -4083,6 +4175,10 @@ jsesc@^1.3.0:
4083 4175
   version "1.3.0"
4084 4176
   resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b"
4085 4177
 
4178
+jsesc@^2.5.1:
4179
+  version "2.5.1"
4180
+  resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.1.tgz#e421a2a8e20d6b0819df28908f782526b96dd1fe"
4181
+
4086 4182
 jsesc@~0.5.0:
4087 4183
   version "0.5.0"
4088 4184
   resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"
@@ -4148,11 +4244,7 @@ jsprim@^1.2.2:
4148 4244
     json-schema "0.2.3"
4149 4245
     verror "1.10.0"
4150 4246
 
4151
-jsx-ast-utils@^1.4.0:
4152
-  version "1.4.1"
4153
-  resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1"
4154
-
4155
-jsx-ast-utils@^2.0.0:
4247
+jsx-ast-utils@^2.0.0, jsx-ast-utils@^2.0.1:
4156 4248
   version "2.0.1"
4157 4249
   resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f"
4158 4250
   dependencies:
@@ -6348,6 +6440,10 @@ regex-parser@^2.2.1:
6348 6440
   version "2.2.8"
6349 6441
   resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.2.8.tgz#da4c0cda5a828559094168930f455f532b6ffbac"
6350 6442
 
6443
+regexpp@^1.0.1:
6444
+  version "1.1.0"
6445
+  resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-1.1.0.tgz#0e3516dd0b7904f413d2d4193dce4618c3a689ab"
6446
+
6351 6447
 regexpu-core@^1.0.0:
6352 6448
   version "1.0.0"
6353 6449
   resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-1.0.0.tgz#86a763f58ee4d7c2f6b102e4764050de7ed90c6b"
@@ -6894,7 +6990,7 @@ source-map@^0.4.2, source-map@^0.4.4:
6894 6990
   dependencies:
6895 6991
     amdefine ">=0.0.4"
6896 6992
 
6897
-source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.6:
6993
+source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1, source-map@~0.5.6:
6898 6994
   version "0.5.7"
6899 6995
   resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
6900 6996
 
@@ -7143,7 +7239,7 @@ symbol-tree@^3.2.1:
7143 7239
   version "3.2.2"
7144 7240
   resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6"
7145 7241
 
7146
-table@^4.0.1:
7242
+table@4.0.2:
7147 7243
   version "4.0.2"
7148 7244
   resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36"
7149 7245
   dependencies: