{"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,"search_vec":"'2017':76 '5.1.0':54 'accord':24 'allow':38 'altern':87 'babel':5,27,50,104,106,110,114 'babel-plugin':105 'babel-plugin-root-import':26,49,113 'babel-root-import':109 'babelrc':36 'compat':47 'configur':31 'deprec':82 'due':84 'e.g':23 'eslint':2,13,90,95,97,101 'eslint-import-resolv':100 'eslint-import-resolver-babel-plugin-root-import':1 'eslint-import-resolver-typescript':89 'eslint-plugin-import':12,96 'eslintrc':42 'fix':46 'fork':44 'function':79 'import':3,8,15,30,53,91,99,102,112,117 'indic':77 'inlin':39 'javascript':94 'like':88 'map':17 'modul':21,108 'newer':86 'older':62 'option':40 'origin':57 'packag':71 'path':22 'plugin':6,14,28,51,98,107,115 'potenti':81 'purpos':70 'read':33 'relat':20 'resolv':4,10,58,92,103 'risk':83 'root':7,19,29,52,111,116 'root-rel':18 'set':34 'sinc':75 'singl':69 'single-purpos':68 'small':67 'stabl':78 'support':61 'typescript':93 'unlik':55 'updat':74 'v1.1.1':45 'version':63","created_at":"2026-04-25T11:18:56.950850+00:00","updated_at":"2026-04-25T11:18:56.950850+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/unconfident/eslint-import-resolver-babel-plugin-root-import","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-import-resolver-babel-plugin-root-import","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}