refactor start
This commit is contained in:
parent
bd49791e06
commit
e46d25f0b7
16699 changed files with 2 additions and 1484887 deletions
50
home/ags/node_modules/eslint/lib/rules/no-sparse-arrays.js
generated
vendored
50
home/ags/node_modules/eslint/lib/rules/no-sparse-arrays.js
generated
vendored
|
|
@ -1,50 +0,0 @@
|
|||
/**
|
||||
* @fileoverview Disallow sparse arrays
|
||||
* @author Nicholas C. Zakas
|
||||
*/
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "problem",
|
||||
|
||||
docs: {
|
||||
description: "Disallow sparse arrays",
|
||||
recommended: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-sparse-arrays"
|
||||
},
|
||||
|
||||
schema: [],
|
||||
|
||||
messages: {
|
||||
unexpectedSparseArray: "Unexpected comma in middle of array."
|
||||
}
|
||||
},
|
||||
|
||||
create(context) {
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Public
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
return {
|
||||
|
||||
ArrayExpression(node) {
|
||||
|
||||
const emptySpot = node.elements.includes(null);
|
||||
|
||||
if (emptySpot) {
|
||||
context.report({ node, messageId: "unexpectedSparseArray" });
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue