Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-visitor-keys

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-visitor-keys

Constants and utilities about visitor keys to traverse AST.

  • 3.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
82M
increased by6.9%
Maintainers
2
Weekly downloads
 
Created

What is eslint-visitor-keys?

The eslint-visitor-keys package is designed to provide a list of keys that ESLint uses to visit properties in an Abstract Syntax Tree (AST). This is particularly useful for developers working on tools that need to manipulate or analyze JavaScript code, as it helps in navigating the structure of the code in a predictable manner.

What are eslint-visitor-keys's main functionalities?

Retrieving Visitor Keys

This feature allows you to retrieve a comprehensive list of visitor keys used by ESLint. These keys represent the properties of AST nodes that ESLint will traverse. The code sample demonstrates how to import and log the visitor keys.

const visitorKeys = require('eslint-visitor-keys').KEYS;
console.log(visitorKeys);

Union With Custom Keys

This feature enables the combination of ESLint's default visitor keys with custom keys defined by the user. This is useful for tools that work with custom syntax or AST nodes not covered by the default set. The code sample shows how to merge custom keys with the default ones.

const { unionWith } = require('eslint-visitor-keys');
const customKeys = { CustomNode: ['property'] };
const combinedKeys = unionWith(customKeys);
console.log(combinedKeys);

Other packages similar to eslint-visitor-keys

FAQs

Package last updated on 08 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc