Add explicit type declarations for array variables whose type can not be inferred
- ⭐️ This rule is included in
plugin:sppt/recommended
preset.
let a: number[] = [];
let a = Array<number>();
let a = Array<number>(5);
let a = new Array<number>();
let a = new Array<number>(5);
let a = [];
Errors: Add explicit type declarations for array variables whose type can not be inferred
let a = Array();
Errors: Add explicit type declarations for array variables whose type can not be inferred
let a = Array(5);
Errors: Add explicit type declarations for array variables whose type can not be inferred
let a = new Array();
Errors: Add explicit type declarations for array variables whose type can not be inferred
let a = [];
let b = new Array(5);
let c = new Array(5);
let d = new Array<number>(5);
Errors: Add explicit type declarations for array variables whose type can not be inferred Add explicit type declarations for array variables whose type can not be inferred Add explicit type declarations for array variables whose type can not be inferred
(TODO: why is this rule useful?)
(TODO: how does this rule check code?)
(TODO: what do options exist?)