Lint shuffle-array (#45714)

This commit is contained in:
Eli Barzilay 2020-06-25 19:28:01 -04:00 committed by GitHub
parent 272aa77de8
commit 8ab344134f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 12 deletions

View File

@ -4,7 +4,6 @@
// jwulf0 <https://github.com/jwulf0>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* copy - Sets if should return a shuffled copy of the given array. By default it's a falsy value.
* rng - Specifies a custom random number generator.

View File

@ -1,17 +1,16 @@
import shuffle = require('shuffle-array');
// shuffle()
var a = [1, 2, 3, 4, 5];
var result: number[];
const a = [1, 2, 3, 4, 5];
let result: number[];
result = shuffle(a);
result = shuffle(a, {});
result = shuffle(a, {copy: true});
result = shuffle(a, {rng: () => 0});
result = shuffle(a, {copy: true, rng: () => 0});
var b = ['aaa', 'bbb', 'ccc']
var result2: string | string[];
const b = ['aaa', 'bbb', 'ccc'];
let result2: string | string[];
result2 = shuffle.pick(b);
result2 = shuffle.pick(b, {});
result2 = shuffle.pick(b, {picks: 3});

View File

@ -1,13 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"ban-types": false,
"callable-types": false,
"no-consecutive-blank-lines": false,
"no-redundant-jsdoc": false,
"no-var-keyword": false,
"prefer-const": false,
"prefer-method-signature": false,
"semicolon": false,
"trim-file": false
}