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

eslint-import-resolver-babel-plugin-root-import

JSON →
library1.1.1jsnpmunverified

A resolver for eslint-plugin-import that maps root-relative module paths (e.g., '@/', '~/') according to babel-plugin-root-import configuration. It reads settings from `.babelrc` or allows inline options in `.eslintrc`. This fork (v1.1.1) fixes compatibility with babel-plugin-root-import ^5.1.0, unlike the original resolver which only supported older versions. It is a small, single-purpose package with no updates since 2017, indicating stable functionality but potential deprecation risk due to newer alternatives like eslint-import-resolver-typescript.

npm install eslint-import-resolver-babel-plugin-root-import
INSTALL
IMPORT
SIG · ESLINT-IMPORT-RESO
E
eslint-import-resolver-babel-plugin-root-import
testingjavascriptv1.1.1
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.

resolver
✓ settings: { 'import/resolver': 'babel-plugin-root-import' }
✗ using import/resolver: 'eslint-import-resolver-babel-plugin-root-import'
The resolver is configured as a string name, not a require/import statement.

Shows how to configure the resolver in .eslintrc (inline or via .babelrc) and how root-relative imports are resolved.

// .eslintrc.json { "settings": { "import/resolver": { "babel-plugin-root-import": { "rootPathPrefix": "@", "rootPathSuffix": "src" } } } } // With .babelrc configuration, just use: // "import/resolver": "babel-plugin-root-import" // .babelrc example: { "plugins": [ ["babel-plugin-root-import", { "rootPathPrefix": "~", "rootPathSuffix": "src/js" }] ] } // Then in code: import MyComponent from '@/components/MyComponent'; // resolves to src/components/MyComponent import utils from '~/utils/helpers'; // resolves to src/js/utils/helpers
Debug
Known issues
gotchaResolver only reads configuration from .babelrc file; it does not support babel.config.js or other modern Babel config formats.
fix
If using babel.config.js, pass options inline in .eslintrc as shown in the quickstart.
affects: >=1.0.0
breakingIncompatible with eslint-plugin-import <1.9.2 due to resolver interface changes.
fix
Upgrade eslint-plugin-import to >=1.9.2.
affects: >=1.0.0
deprecatedPackage is not actively maintained; last release in 2017. Consider alternatives like eslint-import-resolver-typescript or eslint-import-resolver-webpack.
fix
Migrate to a maintained resolver if encountering issues.
affects: >=1.0.0
gotchaWhen using 'import/resolver' as an object, the resolver name must exactly match 'babel-plugin-root-import' (including hyphens).
fix
Use the exact string 'babel-plugin-root-import' as the key.
affects: >=1.0.0
Errors
Common errors & fixes
Module not found: Error: Can't resolve '@/components/MyComponent'
Resolver not configured or configuration mismatch between .babelrc and resolver settings.
fix
Ensure .eslintrc settings include 'import/resolver': 'babel-plugin-root-import' and babel-plugin-root-import is installed and configured.
ESLint: Unable to resolve path to module '@/utils/helpers' (import/no-unresolved)
Resolver not activated or missing peer dependency.
fix
Install eslint-plugin-import and eslint-import-resolver-babel-plugin-root-import, then add settings in .eslintrc.
Cannot find module 'babel-plugin-root-import'
Missing peer dependency babel-plugin-root-import.
fix
Run npm install --save-dev babel-plugin-root-import.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
babel-plugin-root-importrequiredPeer dependency required to read or mimic its configuration for module resolution
eslint-plugin-importrequiredPeer dependency: this resolver is only used as a plugin for eslint-plugin-import
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-import-resolver-babel-plugin-root-import — npm install eslint-import-resolver-babel-plugin-root-import · libregistry