A utility library (v1.0.0, last updated 2016) for merging ESLint visitor objects, enabling shared logic across multiple ESLint rules. It provides a `mergeVisitors` function that combines visitor objects so that all handlers for a given node type run in first-to-last order, with `:exit` handlers in reverse. Commonly used in ESLint plugin development to avoid duplicating common AST traversal logic (e.g., detecting a package import). Stable, but largely superseded by modern ESLint's native support for multiple visitors or `linter-utils`. The package has low maintenance and no known issues.
npm install enhance-visitorsVerified import paths — ran on the pinned version, not inferred.
Demonstrates merging a shared visitor (import detection) with a rule-specific visitor, avoiding duplicate logic.
Be aware of the reverse exit order. If you need consistent ordering, consider using separate listeners or a different merging strategy.
Consider using ESLint's built-in rule composition or linter-utils for new projects.
Always pass an array: `mergeVisitors([obj1, obj2])`. If you pass multiple arguments, behavior is undefined.
Manually declare module or use `any` type.
Use `import { mergeVisitors } from 'enhance-visitors'` or `const enhance = require('enhance-visitors');`Switch to CommonJS or use `export default` if the package supports it (it does not).
Run `npm install --save enhance-visitors`.
No dependency data recorded yet.