no_sparse_arrays

package
v0.1.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoSparseArraysRule = rule.Rule{
	Name: "no-sparse-arrays",
	Run: func(ctx rule.RuleContext, options any) rule.RuleListeners {
		return rule.RuleListeners{
			ast.KindArrayLiteralExpression: func(node *ast.Node) {
				for _, v := range node.AsArrayLiteralExpression().Elements.Nodes {
					if v.Kind == ast.KindOmittedExpression {
						ctx.ReportNode(node, rule.RuleMessage{
							Id:          "unexpectedSparseArray",
							Description: "Unexpected comma in middle of array.",
						})
					}
				}
			},
		}
	},
}

https://eslint.org/docs/latest/rules/no-sparse-arrays

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL