
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
eslint-import-resolver-webpack
Advanced tools
Resolve paths to dependencies, given a webpack.config.js. Plugin for eslint-plugin-import.
The eslint-import-resolver-webpack package is an ESLint plugin that allows you to use Webpack's module resolution in your ESLint configuration. This is particularly useful for projects that use Webpack aliases or custom module resolution paths, ensuring that ESLint can correctly resolve and lint your imports.
Webpack Configuration Integration
This feature allows you to specify a Webpack configuration file in your ESLint settings. ESLint will use this configuration to resolve modules, ensuring that your import statements are correctly validated.
{"settings":{"import/resolver":{"webpack":{"config":"webpack.config.js"}}}}
Custom Webpack Configuration
You can also provide a custom Webpack configuration directly within the ESLint settings. This is useful if you have a simple configuration or want to override specific settings for ESLint.
{"settings":{"import/resolver":{"webpack":{"config":{"resolve":{"alias":{"@components":"./src/components"}}}}}}}
Multiple Webpack Configurations
This feature allows you to specify multiple Webpack configuration files. ESLint will try to resolve modules using each configuration in the order they are provided.
{"settings":{"import/resolver":{"webpack":{"config":["webpack.config.dev.js","webpack.config.prod.js"]}}}}
The eslint-import-resolver-alias package allows you to define custom path aliases for module resolution in ESLint. Unlike eslint-import-resolver-webpack, it does not rely on a Webpack configuration file but instead uses a simpler alias configuration directly in the ESLint settings.
The eslint-import-resolver-node package is a simple resolver for Node.js-style module resolution. It does not support Webpack-specific features like aliases or custom module resolution paths, making it less flexible than eslint-import-resolver-webpack for projects that use Webpack.
The eslint-import-resolver-typescript package is designed for projects using TypeScript. It allows ESLint to resolve modules based on the TypeScript configuration file (tsconfig.json). This package is more suitable for TypeScript projects compared to eslint-import-resolver-webpack, which is more general-purpose.
Webpack-literate module resolution plugin for eslint-plugin-import
.
Published separately to allow pegging to a specific version in case of breaking changes.
Will look for webpack.config.js
as a sibling of the first ancestral package.json
,
or a config
parameter may be provided with another filename/path relative to the
package.json
.
---
settings:
import/resolver: webpack # take all defaults
or with explicit config file name:
---
settings:
import/resolver:
webpack: { config: 'webpack.dev.config.js' }
FAQs
Resolve paths to dependencies, given a webpack.config.js. Plugin for eslint-plugin-import.
The npm package eslint-import-resolver-webpack receives a total of 884,573 weekly downloads. As such, eslint-import-resolver-webpack popularity was classified as popular.
We found that eslint-import-resolver-webpack demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket investigates hidden protestware in npm packages that blocks user interaction and plays the Ukrainian anthem for Russian-language visitors.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.