{"id":19667,"library":"eslint-import-resolver-next","title":"eslint-import-resolver-next","description":"An ESLint resolver plugin for eslint-plugin-import and eslint-plugin-import-x that resolves modules using unrs-resolver (previously oxc-resolver). v0.6.0 migrated from oxc-resolver to unrs-resolver. Supports monorepos, pnpm workspaces, and TypeScript/JavaScript path aliases from tsconfig/jsconfig. Provides a modern alternative to eslint-import-resolver-typescript and eslint-import-resolver-node, with faster resolution and built-in caching control via NEXT_RESOLVER_CACHE_DISABLED environment variable. Publish cadence is irregular but with breaking changes between versions.","status":"active","version":"0.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/kuoruan/eslint-import-resolver-next","tags":["javascript","eslint","eslint-plugin-import","eslint-plugin-import-x","eslint-import-resolver","oxc-resolver","unrs-resolver","typescript"],"install":[{"cmd":"npm install eslint-import-resolver-next","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-import-resolver-next","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-import-resolver-next","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; the resolver is used as a setting in eslint-plugin-import","package":"eslint-plugin-import","optional":true},{"reason":"alternative peer; resolver also supports import-x plugin via createNextImportResolver","package":"eslint-plugin-import-x","optional":true},{"reason":"runtime dependency; used for actual module resolution since v0.6.0","package":"unrs-resolver","optional":false}],"imports":[{"note":"The resolver is configured as a setting in eslint config, not imported directly.","wrong":"const resolver = require('eslint-import-resolver-next').default","symbol":"default (resolver object)","correct":"settings: { 'import/resolver': { next: { /* options */ } } }"},{"note":"Used for eslint-plugin-import-x's 'resolver-next' setting. Available from v0.5.0+.","wrong":"const { createNextImportResolver } = require('eslint-import-resolver-next').default;","symbol":"createNextImportResolver","correct":"const { createNextImportResolver } = require('eslint-import-resolver-next');"},{"note":"TypeScript type for the resolver object. Renamed from NewResolver in v0.5.0.","wrong":"import NextImportResolver from 'eslint-import-resolver-next';","symbol":"NextImportResolver","correct":"import { NextImportResolver } from 'eslint-import-resolver-next';"}],"quickstart":{"code":"// Install: npm install -D eslint-import-resolver-next eslint-plugin-import\n// .eslintrc.js\nmodule.exports = {\n  plugins: ['import'],\n  settings: {\n    'import/resolver': {\n      next: {\n        tsconfig: true,\n        jsconfig: true,\n        alias: {\n          '@': './src'\n        },\n        extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],\n        roots: [process.cwd()]\n      }\n    }\n  },\n  rules: {\n    'import/no-unresolved': 'error',\n    'import/named': 'error'\n  }\n};","lang":"javascript","description":"Configures eslint-import-resolver-next with TypeScript path aliases and custom extensions in an ESLint config."},"warnings":[{"fix":"Update imports: use NextImportResolver instead of NewResolver. Ensure Node version >=14.18.0.","message":"v0.5.0 renamed NewResolver to NextImportResolver and requires Node >=14.18.0.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Review unrs-resolver documentation for valid options. Remove any oxc-resolver-specific options.","message":"v0.6.0 migrated from oxc-resolver to unrs-resolver. Options that were specific to oxc-resolver may not be supported.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"Use absolute paths or ensure relative paths are relative to the package root. Use path.resolve(__dirname, ...) if needed.","message":"The 'alias' option resolves relative paths from the package directory, not from the source file. This can cause unexpected resolution failures.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"If encountering stale resolutions, set environment variable NEXT_RESOLVER_CACHE_DISABLED=1 or clear node_modules/.cache.","message":"Cache can be disabled by setting NEXT_RESOLVER_CACHE_DISABLED=true, but this is not well documented. Inadvertent cache hits can cause stale resolutions.","severity":"gotcha","affected_versions":">=0.5.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install -D eslint-import-resolver-next and ensure it's in devDependencies.","cause":"The resolver is not installed or is not a direct dependency of the project.","error":"Error: ESLint couldn't find the resolver \"next\". Did you install it?"},{"fix":"Install the package in the root or use eslint's resolve plugin configuration to point to the correct location.","cause":"Package not installed or ESLint is running in a monorepo context where the resolved path doesn't include the dependency.","error":"Cannot find module 'eslint-import-resolver-next'"},{"fix":"Update to v0.5.0+ and ensure correct import: const { createNextImportResolver } = require('eslint-import-resolver-next');","cause":"Using createNextImportResolver on a version earlier than v0.5.0, or importing incorrectly.","error":"TypeError: createNextImportResolver is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}