{"id":19659,"library":"eslint-import-resolver-babel-module","title":"eslint-import-resolver-babel-module","description":"A resolver for eslint-plugin-import that uses babel-plugin-module-resolver's alias configuration to resolve module paths. Version 5.3.2 is the current stable release, compatible with @babel/core ^7.0.0-0 and babel-plugin-module-resolver ^3.0.0 || ^4.0.0 || ^5.0.0. It allows ESLint to understand custom module aliases defined in Babel config, preventing false positive import/no-unresolved errors. Unlike eslint-import-resolver-alias or eslint-import-resolver-webpack, it integrates directly with Babel's module resolution, making it ideal for projects using babel-plugin-module-resolver. The package is actively maintained, with updates tracking eslint-plugin-import and babel-plugin-module-resolver releases.","status":"active","version":"5.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/tleunen/eslint-import-resolver-babel-module","tags":["javascript","eslint","eslint-plugin-import","eslint-import-resolver","babel","babel-plugin","module","resolver","alias"],"install":[{"cmd":"npm install eslint-import-resolver-babel-module","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-import-resolver-babel-module","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-import-resolver-babel-module","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This resolver is used as a plugin for eslint-plugin-import; it must be installed and configured.","package":"eslint-plugin-import","optional":false},{"reason":"Required to read Babel configuration and resolve aliases defined via babel-plugin-module-resolver.","package":"@babel/core","optional":false},{"reason":"The actual module resolution logic; this resolver uses its alias map to resolve imports.","package":"babel-plugin-module-resolver","optional":false}],"imports":[{"note":"CommonJS module exports a resolve function; not a named export. Use require() in ESLint config.","wrong":"import { resolve } from 'eslint-import-resolver-babel-module'","symbol":"default (resolve function)","correct":"module.exports = { interfaceVersion: 2, resolve: (source, file, config) => { ... } }"},{"note":"The resolver must be specified as an object, not a string. ESLint passes options to the resolver.","wrong":"{\"settings\": {\"import/resolver\": \"babel-module\"}}","symbol":"(ESLint config import)","correct":"{\"settings\": {\"import/resolver\": {\"babel-module\": {}}}}"},{"note":"This package does not ship TypeScript definitions. Rely on @types/eslint-plugin-import for resolver types.","wrong":"import { Resolver } from 'eslint-import-resolver-babel-module'","symbol":"(TypeScript types)","correct":"// No TypeScript types provided; use @types/eslint-plugin-import if needed"}],"quickstart":{"code":"// Install dependencies\nnpm install --save-dev eslint eslint-plugin-import eslint-import-resolver-babel-module @babel/core babel-plugin-module-resolver\n\n// Configure .babelrc with aliases\n{\n  \"plugins\": [\n    [\"module-resolver\", {\n      \"root\": [\"./src\"],\n      \"alias\": {\n        \"@components\": \"./src/components\",\n        \"@utils\": \"./src/utils\"\n      }\n    }]\n  ]\n}\n\n// Configure .eslintrc\n{\n  \"settings\": {\n    \"import/resolver\": {\n      \"babel-module\": {}\n    }\n  }\n}","lang":"javascript","description":"Installs required packages, sets up Babel aliases, and configures ESLint to resolve those aliases."},"warnings":[{"fix":"Update babel-plugin-module-resolver to ^3.0.0, ^4.0.0, or ^5.0.0.","message":"Version 5.x requires babel-plugin-module-resolver ^3.0.0 || ^4.0.0 || ^5.0.0. Older versions may not be compatible.","severity":"breaking","affected_versions":">=5.0.0 <6.0.0"},{"fix":"Ensure @babel/core and babel-plugin-module-resolver are installed and configured in your project.","message":"Resolves only for Babel projects; if Babel config is missing, ESLint import resolution fails.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Make sure your Babel config is in the root directory or use a project-level babel.config.js.","message":"The resolver reads Babel configuration from the project root (babel.config.js, .babelrc, etc.). Nested configs may be ignored.","severity":"gotcha","affected_versions":">=5.0.0"},{"fix":"If you rely on this feature, check changelog before upgrading.","message":"The option 'allowExistingDirectories' is experimental. It may be removed in future versions.","severity":"deprecated","affected_versions":">=5.0.0 <6.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install --save-dev babel-plugin-module-resolver","cause":"Missing peer dependency.","error":"Error: Cannot find module 'babel-plugin-module-resolver'"},{"fix":"Ensure the resolver is configured correctly in .eslintrc: \"import/resolver\": { \"babel-module\": {} } and that the alias is defined in Babel config.","cause":"Babel alias not recognized by ESLint.","error":"Unable to resolve path to module '@components/Button' (eslintimport/no-unresolved)"},{"fix":"Change to: {\"settings\": {\"import/resolver\": {\"babel-module\": {}}}}","cause":"Using string value instead of object.","error":"ESLint: 'import/resolver' setting must be an object"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}