@eslint-community/eslint-utils
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
eslint-visitor-keys | 3.4.3 | 7.92 kB | Apache-2.0 | prod | |
eslint | 9.1.1 | 2.89 MB | MIT | prod peer |
@eslint-community/eslint-utils is a package that provides utility functions and classes with the goal of creating custom rules for ESLint, the open-source JavaScript linting utility. This package includes key utilities such as getStaticValue
- which evaluates static value on AST - and ReferenceTracker
- which handles assignments and checks the members of modules and globals while handling destructuring.
To use the @eslint-community/eslint-utils in your project, you would first need to install it via npm using the command:
npm install @eslint-community/eslint-utils
Once installed, you can use its utility functions and classes in your JavaScript file as follows:
const eslintUtils = require('@eslint-community/eslint-utils');
// An example of using the getStaticValue() function
const astNode = //... some AST Node;
const staticValue = eslintUtils.getStaticValue(astNode, context);
Please note that these utilities are designed to be used inside the ESLint custom rule definitions. For detailed explanation and examples, consult the official documentation.
The official documentation for the @eslint-community/eslint-utils package is located at this URL: https://eslint-community.github.io/eslint-utils. It's here where you'll find in-depth information about each utility function and class that this package provides, along with their respective usage examples. For changes and release notes of the package, you can refer to the Releases section on the GitHub page.