no-sparse-arrays
Configuration
rslint.config.ts
Rule Details
Disallows sparse arrays, which are array literals that contain empty slots created by extra commas. Sparse arrays can be confusing because the empty slots are undefined but behave differently from explicitly setting an element to undefined (for example, Array.prototype.forEach skips sparse entries). Extra commas are usually a typo.
Examples of incorrect code for this rule:
Examples of correct code for this rule: