Registry / devops / eslint-import-resolver-next

eslint-import-resolver-next

JSON →
library0.6.0jsnpmunverified

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.

npm install eslint-import-resolver-next
INSTALL
IMPORT
SIG · ESLINT-IMPORT-RESO
E
eslint-import-resolver-next
devopsjavascriptv0.6.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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.

default (resolver object)
settings: { 'import/resolver': { next: { /* options */ } } }
const resolver = require('eslint-import-resolver-next').default
The resolver is configured as a setting in eslint config, not imported directly.
createNextImportResolver
const { createNextImportResolver } = require('eslint-import-resolver-next');
const { createNextImportResolver } = require('eslint-import-resolver-next').default;
Used for eslint-plugin-import-x's 'resolver-next' setting. Available from v0.5.0+.
NextImportResolver
import { NextImportResolver } from 'eslint-import-resolver-next';
import NextImportResolver from 'eslint-import-resolver-next';
TypeScript type for the resolver object. Renamed from NewResolver in v0.5.0.

Configures eslint-import-resolver-next with TypeScript path aliases and custom extensions in an ESLint config.

// Install: npm install -D eslint-import-resolver-next eslint-plugin-import // .eslintrc.js module.exports = { plugins: ['import'], settings: { 'import/resolver': { next: { tsconfig: true, jsconfig: true, alias: { '@': './src' }, extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'], roots: [process.cwd()] } } }, rules: { 'import/no-unresolved': 'error', 'import/named': 'error' } };
Debug
Known issues
breakingv0.5.0 renamed NewResolver to NextImportResolver and requires Node >=14.18.0.
fix
Update imports: use NextImportResolver instead of NewResolver. Ensure Node version >=14.18.0.
affects: >=0.5.0
breakingv0.6.0 migrated from oxc-resolver to unrs-resolver. Options that were specific to oxc-resolver may not be supported.
fix
Review unrs-resolver documentation for valid options. Remove any oxc-resolver-specific options.
affects: >=0.6.0
gotchaThe 'alias' option resolves relative paths from the package directory, not from the source file. This can cause unexpected resolution failures.
fix
Use absolute paths or ensure relative paths are relative to the package root. Use path.resolve(__dirname, ...) if needed.
affects: >=0.0.0
gotchaCache can be disabled by setting NEXT_RESOLVER_CACHE_DISABLED=true, but this is not well documented. Inadvertent cache hits can cause stale resolutions.
fix
If encountering stale resolutions, set environment variable NEXT_RESOLVER_CACHE_DISABLED=1 or clear node_modules/.cache.
affects: >=0.5.0
Errors
Common errors & fixes
Error: ESLint couldn't find the resolver "next". Did you install it?
The resolver is not installed or is not a direct dependency of the project.
fix
Run npm install -D eslint-import-resolver-next and ensure it's in devDependencies.
Cannot find module 'eslint-import-resolver-next'
Package not installed or ESLint is running in a monorepo context where the resolved path doesn't include the dependency.
fix
Install the package in the root or use eslint's resolve plugin configuration to point to the correct location.
TypeError: createNextImportResolver is not a function
Using createNextImportResolver on a version earlier than v0.5.0, or importing incorrectly.
fix
Update to v0.5.0+ and ensure correct import: const { createNextImportResolver } = require('eslint-import-resolver-next');
Upgrade
Version history
0.6.0latest on npm
Audit
Dependencies
eslint-plugin-importoptionalpeer dependency; the resolver is used as a setting in eslint-plugin-import
eslint-plugin-import-xoptionalalternative peer; resolver also supports import-x plugin via createNextImportResolver
unrs-resolverrequiredruntime dependency; used for actual module resolution since v0.6.0
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-import-resolver-next — npm install eslint-import-resolver-next · libregistry