2 * @fileoverview Disallow sparse arrays
3 * @author Nicholas C. Zakas
7 //------------------------------------------------------------------------------
9 //------------------------------------------------------------------------------
16 description: "disallow sparse arrays",
17 category: "Possible Errors",
19 url: "https://eslint.org/docs/rules/no-sparse-arrays"
28 //--------------------------------------------------------------------------
30 //--------------------------------------------------------------------------
34 ArrayExpression(node) {
36 const emptySpot = node.elements.indexOf(null) > -1;
39 context.report({ node, message: "Unexpected comma in middle of array." });