Utility functions and classes for developing ESLint custom rules, stable version 3.0.0, released occasionally with major version bumps. Provides static evaluation on AST nodes, reference tracking for modules/globals, and helper functions like getStaticValue(), ReferenceTracker, and PatternMatcher. Differentiators: comprehensive AST utility for ESLint plugin authors, well-documented, and actively maintained by a seasoned contributor. Current version drops support for older Node.js and adds exports field.
npm install eslint-utilsVerified import paths — ran on the pinned version, not inferred.
Shows usage of getStaticValue and ReferenceTracker in an ESLint rule to detect member expressions with static value 'click'.
Use only the package root imports as documented.
Upgrade Node.js to ^10.0.0 || ^12.0.0 || >=14.0.0.
Review rule logic relying on that function's output.
If using globalThis tracking, adjust expectations.
Update to v1.4.1 or later.
Import from root: import { getStaticValue } from 'eslint-utils'Use import syntax or dynamic import(). If using CommonJS project, consider an older version.
Use named import: import { getStaticValue } from 'eslint-utils'