aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-10-09 14:15:13 +0200
committerGitHub <[email protected]>2023-10-09 12:15:13 +0000
commitfe3fb5dd3b8949d952aa8eb3830f58fc9cc4adcc (patch)
treea468f9961788b4989f248c0580bb222b2b224495
parent66b7a14c5f97aca8de63e6039645c89cf9d08d06 (diff)
downloadfaker-fe3fb5dd3b8949d952aa8eb3830f58fc9cc4adcc.tar.xz
faker-fe3fb5dd3b8949d952aa8eb3830f58fc9cc4adcc.zip
infra(unicorn): no-new-array (#2441)
-rw-r--r--.eslintrc.js1
-rw-r--r--src/internal/mersenne.ts2
2 files changed, 1 insertions, 2 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index f7f7c6ff..6b5686f9 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -64,7 +64,6 @@ module.exports = defineConfig({
'unicorn/no-hex-escape': 'off',
'unicorn/no-instanceof-array': 'off',
'unicorn/no-negated-condition': 'off',
- 'unicorn/no-new-array': 'off',
'unicorn/no-object-as-default-parameter': 'off',
'unicorn/no-process-exit': 'off',
'unicorn/no-useless-switch-case': 'off',
diff --git a/src/internal/mersenne.ts b/src/internal/mersenne.ts
index 2d1cc4ce..6be5825d 100644
--- a/src/internal/mersenne.ts
+++ b/src/internal/mersenne.ts
@@ -79,7 +79,7 @@ class MersenneTwister19937 {
private readonly MATRIX_A = 0x9908b0df; // constant vector a
private readonly UPPER_MASK = 0x80000000; // most significant w-r bits
private readonly LOWER_MASK = 0x7fffffff; // least significant r bits
- private mt: number[] = new Array(this.N); // the array for the state vector
+ private mt: number[] = Array.from({ length: this.N }); // the array for the state vector
private mti = this.N + 1; // mti==N+1 means mt[N] is not initialized
/**