Disallow generic Array constructors.
// code-linter.json5
{
"rules": {
"@typescript-eslint/no-array-constructor": "error"
}
} const length = 500; Array(length); export const newArr: number[] = new Array(['1'].length); export const arr = ['0', '1', '2']; export const createArray = (array: string) => new Array(array.length);
plugin:@typescript-eslint/all
For details about how to configure Code Linter check rules, see Code Linter.