eslint-import-resolver-webpack
Resolve paths to dependencies, given a webpack.config.js. Plugin for eslint-plugin-import.
This package has a good security score with no known vulnerabilities.
Community Reviews
Works when configured correctly, but debugging setup issues is painful
The documentation covers basic cases but falls short on complex scenarios like multi-compiler configs, dynamic webpack configurations, or when using newer webpack 5 features. I've spent hours debugging why path aliases weren't resolving, only to discover the resolver was silently failing to parse my webpack config. The GitHub issues are somewhat helpful, but response times vary and many older issues remain unresolved.
Once working, it's largely set-and-forget, which is great. But expect initial setup frustration, especially if your webpack config isn't vanilla. The package does integrate well with eslint-plugin-import when everything aligns, saving you from duplicate path configuration.
Best for: Projects with straightforward, static webpack configurations that need ESLint to understand webpack's module resolution.
Avoid if: You have complex, dynamically-generated webpack configs or need reliable error reporting during development setup.
Works but requires careful configuration and adds significant overhead
Configuration is straightforward when your webpack config is simple, but dynamic configs or multiple configurations require careful setup. The resolver needs to evaluate your webpack config, which means it must run in the same Node environment with all webpack plugins available. This can lead to cryptic errors when dependencies are missing or when using webpack 5's new features. Error messages tend to be vague when resolution fails, making debugging frustrating.
Resource management is minimal - it doesn't pool connections or cache aggressively between runs in watch mode. You'll notice the performance impact most acutely in development. For large monorepos, consider simpler path resolution strategies or explicit ESLint path configuration instead.
Best for: Projects with complex webpack alias configurations that change frequently and need ESLint validation to stay in sync automatically.
Avoid if: You have simple or static path mappings that can be duplicated in ESLint config, or when ESLint performance is critical (CI/CD, pre-commit hooks).
Essential for webpack aliases but configuration can be finicky
In practice, the experience varies wildly depending on your webpack setup complexity. Simple configs work fine, but once you have multiple webpack configs, environment-specific settings, or dynamic configuration logic, things get tricky. Error messages when something goes wrong are often cryptic or nonexistent—imports just silently fail to resolve. The documentation is sparse, providing minimal guidance on troubleshooting or advanced configurations.
Performance can also be a concern on larger projects. Since it needs to evaluate your webpack config for every import resolution, you may notice ESLint slowing down, especially if your webpack config does heavy computation. The TypeScript types exist but are minimal, offering little help with configuration options.
Best for: Projects with simple to moderately complex webpack configurations that use path aliases and need ESLint import validation.
Avoid if: You have highly dynamic webpack configs, can migrate to TypeScript path mapping, or can use simpler alias resolution tools.
Sign in to write a review
Sign In