Skip to content

Commit fc327c5

Browse files
Update ESLint (#2266)
1 parent c444416 commit fc327c5

File tree

4 files changed

+35
-18
lines changed

4 files changed

+35
-18
lines changed

.eslintrc.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ plugins:
99
- flowtype
1010

1111
rules:
12-
# `eslint-plugin-flowtype` rule list based on `v4.3.x`
12+
# `eslint-plugin-flowtype` rule list based on `v4.4.x`
1313
# https://github.com/gajus/eslint-plugin-flowtype#eslint-plugin-flowtype
1414

1515
flowtype/array-style-complex-type: [error, verbose]
@@ -55,7 +55,7 @@ rules:
5555
flowtype/union-intersection-spacing: off
5656

5757
##################################################
58-
# ESLint builtin rules list based on `v6.6.x`
58+
# ESLint builtin rules list based on `v6.7.x`
5959
##################################################
6060

6161
# Possible Errors
@@ -72,6 +72,7 @@ rules:
7272
no-control-regex: error
7373
no-debugger: warn
7474
no-dupe-args: error
75+
no-dupe-else-if: error
7576
no-dupe-keys: error
7677
no-duplicate-case: error
7778
no-empty: error
@@ -87,6 +88,7 @@ rules:
8788
no-obj-calls: error
8889
no-prototype-builtins: error
8990
no-regex-spaces: error
91+
no-setter-return: error
9092
no-sparse-arrays: error
9193
no-template-curly-in-string: error
9294
no-unreachable: error
@@ -110,11 +112,13 @@ rules:
110112
default-param-last: off # TODO
111113
dot-notation: off
112114
eqeqeq: [error, smart]
115+
grouped-accessor-pairs: error
113116
guard-for-in: error
114117
max-classes-per-file: off
115118
no-alert: error
116119
no-caller: error
117120
no-case-declarations: error
121+
no-constructor-return: error
118122
no-div-regex: error
119123
no-else-return: error
120124
no-empty-function: error
@@ -255,6 +259,7 @@ rules:
255259
one-var: [error, never]
256260
operator-assignment: [error, always]
257261
padding-line-between-statements: off
262+
prefer-exponentiation-operator: error
258263
prefer-object-spread: error
259264
quotes: [error, single, { avoidEscape: true, allowTemplateLiterals: false }]
260265
sort-keys: off

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
"babel-eslint": "10.0.3",
5454
"chai": "4.2.0",
5555
"dtslint": "1.0.3",
56-
"eslint": "6.6.0",
57-
"eslint-plugin-flowtype": "4.3.0",
56+
"eslint": "6.7.1",
57+
"eslint-plugin-flowtype": "4.5.2",
5858
"flow-bin": "0.112.0",
5959
"mocha": "6.2.2",
6060
"nyc": "14.1.1",

resources/benchmark.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function computeStats(samples) {
138138
// Compute the sample variance (estimate of the population variance).
139139
let variance = 0;
140140
for (const { clocked } of samples) {
141-
variance += Math.pow(clocked - mean, 2);
141+
variance += (clocked - mean) ** 2;
142142
}
143143
variance /= samples.length - 1;
144144

@@ -223,7 +223,7 @@ function beautifyBenchmark(results) {
223223
function beautifyBytes(bytes) {
224224
const sizes = ['Bytes', 'KB', 'MB', 'GB'];
225225
const i = Math.floor(Math.log2(bytes) / 10);
226-
return beautifyNumber(bytes / Math.pow(2, i * 10)) + ' ' + sizes[i];
226+
return beautifyNumber(bytes / 2 ** (i * 10)) + ' ' + sizes[i];
227227
}
228228

229229
function beautifyNumber(num) {

yarn.lock

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,10 +1250,10 @@ [email protected], escape-string-regexp@^1.0.2, escape-string-regexp@^1
12501250
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
12511251
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
12521252

1253-
eslint-plugin-flowtype@4.3.0:
1254-
version "4.3.0"
1255-
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-4.3.0.tgz#06d0837ac341caf369e7e6dbb112dd7fd21acf17"
1256-
integrity sha512-elvqoadMHnYqSYN1YXn02DR7SFW8Kc2CLe8na3m2GdQPQhIY+BgCd2quVJ1AbW3aO0zcyE9loVJ7Szy8A/xlMA==
1253+
eslint-plugin-flowtype@4.5.2:
1254+
version "4.5.2"
1255+
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-4.5.2.tgz#5353449692663ef70e8fc8c2386cebdecac7e86b"
1256+
integrity sha512-ByV0EtEQOqiCl6bsrtXtTGnXlIXoyvDrvUq3Nz28huODAhnRDuMotyTrwP+TjAKZMPWbtaNGFHMoUxW3DktGOw==
12571257
dependencies:
12581258
lodash "^4.17.15"
12591259

@@ -1277,10 +1277,10 @@ eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0:
12771277
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2"
12781278
integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==
12791279

1280-
eslint@6.6.0:
1281-
version "6.6.0"
1282-
resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.6.0.tgz#4a01a2fb48d32aacef5530ee9c5a78f11a8afd04"
1283-
integrity sha512-PpEBq7b6qY/qrOmpYQ/jTMDYfuQMELR4g4WI1M/NaSDDD/bdcMb+dj4Hgks7p41kW2caXsPsEZAEAyAgjVVC0g==
1280+
eslint@6.7.1:
1281+
version "6.7.1"
1282+
resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.7.1.tgz#269ccccec3ef60ab32358a44d147ac209154b919"
1283+
integrity sha512-UWzBS79pNcsDSxgxbdjkmzn/B6BhsXMfUaOHnNwyE8nD+Q6pyT96ow2MccVayUTV4yMid4qLhMiQaywctRkBLA==
12841284
dependencies:
12851285
"@babel/code-frame" "^7.0.0"
12861286
ajv "^6.10.0"
@@ -1297,7 +1297,7 @@ [email protected]:
12971297
file-entry-cache "^5.0.1"
12981298
functional-red-black-tree "^1.0.1"
12991299
glob-parent "^5.0.0"
1300-
globals "^11.7.0"
1300+
globals "^12.1.0"
13011301
ignore "^4.0.6"
13021302
import-fresh "^3.0.0"
13031303
imurmurhash "^0.1.4"
@@ -1310,7 +1310,7 @@ [email protected]:
13101310
minimatch "^3.0.4"
13111311
mkdirp "^0.5.1"
13121312
natural-compare "^1.4.0"
1313-
optionator "^0.8.2"
1313+
optionator "^0.8.3"
13141314
progress "^2.0.0"
13151315
regexpp "^2.0.1"
13161316
semver "^6.1.2"
@@ -1572,11 +1572,18 @@ glob@^7.1.1, glob@^7.1.3:
15721572
once "^1.3.0"
15731573
path-is-absolute "^1.0.0"
15741574

1575-
globals@^11.1.0, globals@^11.7.0:
1575+
globals@^11.1.0:
15761576
version "11.12.0"
15771577
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
15781578
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==
15791579

1580+
globals@^12.1.0:
1581+
version "12.3.0"
1582+
resolved "https://registry.yarnpkg.com/globals/-/globals-12.3.0.tgz#1e564ee5c4dded2ab098b0f88f24702a3c56be13"
1583+
integrity sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw==
1584+
dependencies:
1585+
type-fest "^0.8.1"
1586+
15801587
graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6:
15811588
version "4.2.3"
15821589
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"
@@ -2296,7 +2303,7 @@ optimist@^0.6.1:
22962303
minimist "~0.0.1"
22972304
wordwrap "~0.0.2"
22982305

2299-
optionator@^0.8.2:
2306+
optionator@^0.8.3:
23002307
version "0.8.3"
23012308
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495"
23022309
integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==
@@ -3031,6 +3038,11 @@ type-fest@^0.5.2:
30313038
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.5.2.tgz#d6ef42a0356c6cd45f49485c3b6281fc148e48a2"
30323039
integrity sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw==
30333040

3041+
type-fest@^0.8.1:
3042+
version "0.8.1"
3043+
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
3044+
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==
3045+
30343046
typescript@next:
30353047
version "3.8.0-dev.20191105"
30363048
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.0-dev.20191105.tgz#84936856168f081f8ffd67441c76f439c97fb9b7"

0 commit comments

Comments
 (0)