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.

testing
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

The resolver is referenced by the shorthand name 'babel-root-import' in .eslintrc, not the package name.

"settings": { "import/resolver": "babel-root-import" }

This is the underlying plugin that must also be configured in Babel.

require('babel-plugin-root-import')

Options are passed as an object to the resolver, matching babel-plugin-root-import's configuration.

"settings": { "import/resolver": { "babel-root-import": { "rootPathSuffix": "src" } } }

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 footguns
breakingVersion 1.0.0 changed the resolver name from 'eslint-import-resolver-babel-root-import' to 'babel-root-import' in settings.
deprecatedThe babel-plugin-root-import package was renamed and is now maintained under a new repository.
gotchaThe resolver requires babel-plugin-root-import to be installed and configured separately.
gotchaThis resolver may not work with eslint-plugin-import versions that have breaking changes in the resolver API.
breakingThe package has very limited documentation and may break silently if dependencies are mismatched.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
4
ahrefsbot
4
script
1
Resources