Registry / testing / eslint-import-resolver-babel-root-import

eslint-import-resolver-babel-root-import

JSON →
library0.0.2jsnpmunverified

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.

npm install eslint-import-resolver-babel-root-import
INSTALL
IMPORT
SIG · ESLINT-IMPORT-RESO
E
eslint-import-resolver-babel-root-import
testingjavascriptv0.0.2
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

eslint-import-resolver-babel-root-import
✓ "settings": { "import/resolver": "babel-root-import" }
✗ "settings": { "import/resolver": "eslint-import-resolver-babel-root-import" }
The resolver is referenced by the shorthand name 'babel-root-import' in .eslintrc, not the package name.
babel-plugin-root-import
✓ require('babel-plugin-root-import')
This is the underlying plugin that must also be configured in Babel.
import/resolver object
✓ "settings": { "import/resolver": { "babel-root-import": { "rootPathSuffix": "src" } } }
Options are passed as an object to the resolver, matching babel-plugin-root-import's configuration.

This shows how to configure eslint-plugin-import to use the babel-root-import resolver and install the necessary dependencies.

// .eslintrc.json { "settings": { "import/resolver": { "babel-root-import": { "rootPathSuffix": "src", "rootPathPrefix": "~" } } } } // Install npm install --save-dev eslint-plugin-import eslint-import-resolver-babel-root-import babel-plugin-root-import
Debug
Known issues
breakingVersion 1.0.0 changed the resolver name from 'eslint-import-resolver-babel-root-import' to 'babel-root-import' in settings.
fix
Update your .eslintrc to use the shorthand 'babel-root-import' instead of the full package name.
affects: <1.0.0
deprecatedThe babel-plugin-root-import package was renamed and is now maintained under a new repository.
fix
Ensure you are using the most up-to-date version of babel-plugin-root-import.
affects: all
gotchaThe resolver requires babel-plugin-root-import to be installed and configured separately.
fix
Install both packages and configure babel-plugin-root-import in your Babel config.
affects: all
gotchaThis resolver may not work with eslint-plugin-import versions that have breaking changes in the resolver API.
fix
Check compatibility with your eslint-plugin-import version; consider using the built-in eslint-import-resolver-node or eslint-import-resolver-alias.
affects: >=2.18.0
breakingThe package has very limited documentation and may break silently if dependencies are mismatched.
fix
Use a more robust resolver like eslint-import-resolver-alias if you need extensive support.
affects: all
Errors
Common errors & fixes
Error: No resolver found for 'babel-root-import'
The resolver is not installed or not referenced correctly in .eslintrc.
fix
Run `npm install --save-dev eslint-import-resolver-babel-root-import` and use 'babel-root-import' in settings.
Unable to resolve path to module '~/components/Button'
The root path mapping is not configured or babel-plugin-root-import is not set up.
fix
Configure both the resolver in .eslintrc and the plugin in your Babel config with same settings.
Resolve error: Failed to load resolver: babel-root-import
The package does not export the correct resolver interface for eslint-plugin-import.
fix
Check that you have the correct version (v1.0.0) and that babel-plugin-root-import is installed.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
babel-plugin-root-importrequiredCore dependency that provides the root import mapping logic.
eslint-plugin-importoptionalPeer dependency required for resolver integration.
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-import-resolver-babel-root-import — npm install eslint-import-resolver-babel-root-import · libregistry