Vite module resolution plugin for eslint-plugin-import and eslint-plugin-import-x (resolver interface v3). Current stable version v2.1.1 (released 2025-04). Supports ESM, CJS, and mixed setups. Handles `resolve.alias` from Vite config. Critically, v2.x requires users to provide the config object explicitly, avoiding require() issues in mixed setups. Active development. Key differentiator: lightweight alternative to eslint-import-resolver-typescript when using Vite's alias feature.
npm install eslint-import-resolver-viteVerified import paths — ran on the pinned version, not inferred.
Setup eslint-import-resolver-vite with a Vite alias config and use it in ESLint settings.
Provide `viteConfig` option: `{ viteConfig: require('./vite.config').config }`Use a separate CJS config file or convert to ESM config and use `import()` in a dynamic context.
For other custom resolution, consider using eslint-import-resolver-typescript or other resolvers.
Use `createViteImportResolver` for v3, or upgrade to the latest version of eslint-plugin-import-x.
Check that you have passed the correct `viteConfig` object with `resolve.alias` defined.
Run `npm install --save-dev eslint-import-resolver-vite` and ensure the module is in `node_modules`.
Provide a valid Vite config object: `{ viteConfig: { resolve: { alias: { ... } } } }`