no_proto

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoProtoRule = rule.Rule{
	Name: "no-proto",
	Run: func(ctx rule.RuleContext, options any) rule.RuleListeners {
		msg := rule.RuleMessage{
			Id:          "unexpectedProto",
			Description: "The '__proto__' property is deprecated.",
		}

		return rule.RuleListeners{
			ast.KindPropertyAccessExpression: func(node *ast.Node) {
				propAccess := node.AsPropertyAccessExpression()
				if propAccess.Name().Text() == "__proto__" {
					ctx.ReportNode(node, msg)
				}
			},
			ast.KindElementAccessExpression: func(node *ast.Node) {
				elemAccess := node.AsElementAccessExpression()
				if utils.GetStaticStringValue(elemAccess.ArgumentExpression) == "__proto__" {
					ctx.ReportNode(node, msg)
				}
			},
		}
	},
}

https://eslint.org/docs/latest/rules/no-proto

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