{"id":19660,"library":"eslint-import-resolver-babel-root-import","title":"eslint-import-resolver-babel-root-import","description":"A resolver for eslint-plugin-import that works with babel-plugin-root-import to allow root-based module imports (e.g., importing from a root directory using a pattern). The current stable version is 1.0.0, released as a major update. This package is a thin wrapper around babel-plugin-root-import, providing an eslint resolver that understands the same root-import syntax. It has no active development. The key differentiator is enabling eslint-plugin-import to resolve modules using the babel-root-import plugin's custom prefix/suffix mappings.","status":"maintenance","version":"0.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/olalonde/eslint-import-resolver-babel-root-import","tags":["javascript","eslint","eslint-plugin-import","eslint-import-resolver","babel","babel-plugin","module","babel-root-import","rewrite"],"install":[{"cmd":"npm install eslint-import-resolver-babel-root-import","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-import-resolver-babel-root-import","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-import-resolver-babel-root-import","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency that provides the root import mapping logic.","package":"babel-plugin-root-import","optional":false},{"reason":"Peer dependency required for resolver integration.","package":"eslint-plugin-import","optional":true}],"imports":[{"note":"The resolver is referenced by the shorthand name 'babel-root-import' in .eslintrc, not the package name.","wrong":"\"settings\": { \"import/resolver\": \"eslint-import-resolver-babel-root-import\" }","symbol":"eslint-import-resolver-babel-root-import","correct":"\"settings\": { \"import/resolver\": \"babel-root-import\" }"},{"note":"This is the underlying plugin that must also be configured in Babel.","wrong":"","symbol":"babel-plugin-root-import","correct":"require('babel-plugin-root-import')"},{"note":"Options are passed as an object to the resolver, matching babel-plugin-root-import's configuration.","wrong":"","symbol":"import/resolver object","correct":"\"settings\": { \"import/resolver\": { \"babel-root-import\": { \"rootPathSuffix\": \"src\" } } }"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"settings\": {\n    \"import/resolver\": {\n      \"babel-root-import\": {\n        \"rootPathSuffix\": \"src\",\n        \"rootPathPrefix\": \"~\"\n      }\n    }\n  }\n}\n\n// Install\nnpm install --save-dev eslint-plugin-import eslint-import-resolver-babel-root-import babel-plugin-root-import","lang":"json","description":"This shows how to configure eslint-plugin-import to use the babel-root-import resolver and install the necessary dependencies."},"warnings":[{"fix":"Update your .eslintrc to use the shorthand 'babel-root-import' instead of the full package name.","message":"Version 1.0.0 changed the resolver name from 'eslint-import-resolver-babel-root-import' to 'babel-root-import' in settings.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Ensure you are using the most up-to-date version of babel-plugin-root-import.","message":"The babel-plugin-root-import package was renamed and is now maintained under a new repository.","severity":"deprecated","affected_versions":"all"},{"fix":"Install both packages and configure babel-plugin-root-import in your Babel config.","message":"The resolver requires babel-plugin-root-import to be installed and configured separately.","severity":"gotcha","affected_versions":"all"},{"fix":"Check compatibility with your eslint-plugin-import version; consider using the built-in eslint-import-resolver-node or eslint-import-resolver-alias.","message":"This resolver may not work with eslint-plugin-import versions that have breaking changes in the resolver API.","severity":"gotcha","affected_versions":">=2.18.0"},{"fix":"Use a more robust resolver like eslint-import-resolver-alias if you need extensive support.","message":"The package has very limited documentation and may break silently if dependencies are mismatched.","severity":"breaking","affected_versions":"all"}],"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 eslint-import-resolver-babel-root-import` and use 'babel-root-import' in settings.","cause":"The resolver is not installed or not referenced correctly in .eslintrc.","error":"Error: No resolver found for 'babel-root-import'"},{"fix":"Configure both the resolver in .eslintrc and the plugin in your Babel config with same settings.","cause":"The root path mapping is not configured or babel-plugin-root-import is not set up.","error":"Unable to resolve path to module '~/components/Button'"},{"fix":"Check that you have the correct version (v1.0.0) and that babel-plugin-root-import is installed.","cause":"The package does not export the correct resolver interface for eslint-plugin-import.","error":"Resolve error: Failed to load resolver: babel-root-import"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}