{"id":19658,"library":"eslint-import-resolver-babel-plugin-root-import","title":"eslint-import-resolver-babel-plugin-root-import","description":"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.","status":"maintenance","version":"1.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/unconfident/eslint-import-resolver-babel-plugin-root-import","tags":["javascript","eslint","eslint-plugin-import","eslint-import-resolver","babel","babel-plugin","module","babel-root-import","babel-plugin-root-import"],"install":[{"cmd":"npm install eslint-import-resolver-babel-plugin-root-import","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-import-resolver-babel-plugin-root-import","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-import-resolver-babel-plugin-root-import","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required to read or mimic its configuration for module resolution","package":"babel-plugin-root-import","optional":false},{"reason":"Peer dependency: this resolver is only used as a plugin for eslint-plugin-import","package":"eslint-plugin-import","optional":false}],"imports":[{"note":"The resolver is configured as a string name, not a require/import statement.","wrong":"using import/resolver: 'eslint-import-resolver-babel-plugin-root-import'","symbol":"resolver","correct":"settings: { 'import/resolver': 'babel-plugin-root-import' }"}],"quickstart":{"code":"// .eslintrc.json\n{\n  \"settings\": {\n    \"import/resolver\": {\n      \"babel-plugin-root-import\": {\n        \"rootPathPrefix\": \"@\",\n        \"rootPathSuffix\": \"src\"\n      }\n    }\n  }\n}\n\n// With .babelrc configuration, just use:\n// \"import/resolver\": \"babel-plugin-root-import\"\n// .babelrc example:\n{\n  \"plugins\": [\n    [\"babel-plugin-root-import\", {\n      \"rootPathPrefix\": \"~\",\n      \"rootPathSuffix\": \"src/js\"\n    }]\n  ]\n}\n\n// Then in code:\nimport MyComponent from '@/components/MyComponent'; // resolves to src/components/MyComponent\nimport utils from '~/utils/helpers'; // resolves to src/js/utils/helpers","lang":"javascript","description":"Shows how to configure the resolver in .eslintrc (inline or via .babelrc) and how root-relative imports are resolved."},"warnings":[{"fix":"If using babel.config.js, pass options inline in .eslintrc as shown in the quickstart.","message":"Resolver only reads configuration from .babelrc file; it does not support babel.config.js or other modern Babel config formats.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade eslint-plugin-import to >=1.9.2.","message":"Incompatible with eslint-plugin-import <1.9.2 due to resolver interface changes.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Migrate to a maintained resolver if encountering issues.","message":"Package is not actively maintained; last release in 2017. Consider alternatives like eslint-import-resolver-typescript or eslint-import-resolver-webpack.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use the exact string 'babel-plugin-root-import' as the key.","message":"When using 'import/resolver' as an object, the resolver name must exactly match 'babel-plugin-root-import' (including hyphens).","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure .eslintrc settings include 'import/resolver': 'babel-plugin-root-import' and babel-plugin-root-import is installed and configured.","cause":"Resolver not configured or configuration mismatch between .babelrc and resolver settings.","error":"Module not found: Error: Can't resolve '@/components/MyComponent'"},{"fix":"Install eslint-plugin-import and eslint-import-resolver-babel-plugin-root-import, then add settings in .eslintrc.","cause":"Resolver not activated or missing peer dependency.","error":"ESLint: Unable to resolve path to module '@/utils/helpers' (import/no-unresolved)"},{"fix":"Run npm install --save-dev babel-plugin-root-import.","cause":"Missing peer dependency babel-plugin-root-import.","error":"Cannot find module 'babel-plugin-root-import'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}