{"id":19791,"library":"eslint-plugin-import-exports-imports-resolver","title":"eslint-plugin-import-exports-imports-resolver","description":"A custom resolver for eslint-plugin-import that resolves package exports and imports defined in the exports and imports fields of package.json. Version 1.0.1 is the only published version. It eliminates false positives for import/no-unresolved when using package.json exports and imports (e.g., #imports or subpath exports). Different from the default node resolver, which does not support these fields. Supports aliases and custom module directories. Works with both CJS and ESM configs, but requires eslint-plugin-import to be installed. No known alternative resolvers for this specific use case.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/thepassle/eslint-plugin-import-exports-imports-resolver","tags":["javascript","eslint","eslint-plugin-import","resolver"],"install":[{"cmd":"npm install eslint-plugin-import-exports-imports-resolver","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-import-exports-imports-resolver","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-import-exports-imports-resolver","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This is a resolver plugin for eslint-plugin-import and requires it to be installed and configured.","package":"eslint-plugin-import","optional":false}],"imports":[{"note":"This package is CJS-only, so require() is correct. ESM import may fail or require special handling.","wrong":"import resolver from 'eslint-plugin-import-exports-imports-resolver';","symbol":"(default)","correct":"const resolver = require('eslint-plugin-import-exports-imports-resolver');"},{"note":"In JSON config, you must use the full path to index.js, not the package name, because settings.import/resolver expects a module path.","wrong":"'eslint-plugin-import-exports-imports-resolver'","symbol":"required path","correct":"'./node_modules/eslint-plugin-import-exports-imports-resolver/index.js'"},{"note":"In JS config, use require.resolve() to get the absolute path. Using require() directly may work but is less reliable.","wrong":"require('eslint-plugin-import-exports-imports-resolver')","symbol":"require.resolve usage","correct":"require.resolve('eslint-plugin-import-exports-imports-resolver')"}],"quickstart":{"code":"// .eslintrc.js\nmodule.exports = {\n  settings: {\n    'import/resolver': {\n      [require.resolve('eslint-plugin-import-exports-imports-resolver')]: {\n        alias: {\n          'my-alias': 'my-alias-v2'\n        },\n        node: {\n          moduleDirectory: ['node_modules', 'bower_components']\n        }\n      },\n    },\n  },\n  rules: {\n    'import/no-unresolved': 'error',\n  },\n};\n\n// Then in your source files:\nimport { foo } from '#local'; // resolves via imports field\nimport { bar } from 'pkg/subpath'; // resolves via exports field","lang":"javascript","description":"Configures the resolver in a .eslintrc.js file with an alias and custom module directories, enabling resolution of package imports and exports."},"warnings":[{"fix":"Use './node_modules/eslint-plugin-import-exports-imports-resolver/index.js' instead of the package name.","message":"JSON config requires full path to index.js, not package name.","severity":"gotcha","affected_versions":">=1.0.1"},{"fix":"Use require() instead of import.","message":"Package is CJS-only; ESM imports may not work.","severity":"gotcha","affected_versions":">=1.0.1"},{"fix":"Install eslint-plugin-import and configure it with import/no-unresolved rule enabled.","message":"Must have eslint-plugin-import installed and configured.","severity":"gotcha","affected_versions":">=1.0.1"},{"fix":"Use explicit alias mappings, e.g., 'project-foo' -> 'project-foo-v1'.","message":"Alias configuration requires exact path matching; wildcards not supported.","severity":"gotcha","affected_versions":">=1.0.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Replace 'eslint-plugin-import-exports-imports-resolver' with './node_modules/eslint-plugin-import-exports-imports-resolver/index.js' in settings.import/resolver.","cause":"In JSON config, the package name is used instead of the full path to index.js.","error":"Unable to resolve path to module 'eslint-plugin-import-exports-imports-resolver'"},{"fix":"Run 'npm install eslint-plugin-import --save-dev'.","cause":"eslint-plugin-import is not installed.","error":"Cannot find module 'eslint-plugin-import'"},{"fix":"Add a settings object with 'import' key: settings: { 'import': { resolver: { ... } } }.","cause":"settings.import is not defined in ESLint config.","error":"Expected 'import/resolver' to be an object, got undefined"},{"fix":"Ensure your package.json has an 'imports' field mapping '#foo' to a valid path, e.g., { \"imports\": { \"#foo\": \"./bar.js\" } }.","cause":"The 'imports' field in package.json is missing or incorrectly configured.","error":"import/no-unresolved: Unable to resolve path to module '#foo'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}