eslint-import-resolver-oxc

raw JSON →
0.15.0 verified Sat Apr 25 auth: no javascript

An ESLint import resolver wrapping oxc-resolver for eslint-plugin-import and eslint-plugin-import-x. Current stable version is 0.15.0, with frequent releases (multiple minor/patch versions in 2024). Key differentiators: significantly faster than eslint-import-resolver-node by leveraging the Rust-based oxc-resolver; supports configuration via bundler configs (Vite, Rspack, Webpack) and auto-detection of tsconfig/jsconfig; offers both sync and async resolver-next API. Ships TypeScript types, ESM/CJS compatible, and requires oxc-resolver as a peer dependency. Community alternative to eslint-import-resolver-typescript.

error Cannot find module 'oxc-resolver'
cause oxc-resolver is a peer dependency and not automatically installed.
fix
Install oxc-resolver: npm install oxc-resolver --save-dev
error Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'eslint-import-resolver-oxc'
cause Misconfiguration or package not installed.
fix
Ensure package is installed: npm install eslint-import-resolver-oxc --save-dev. If using ESM, check package.json has "type": "module" or use .mjs extension.
error Invalid resolver configuration: unsupported resolver type
cause Using an incorrect key for the resolver in settings.
fix
Use 'import-x/resolver-next' for eslint-plugin-import-x >=4.5.0, or 'import-x/resolver' for older versions.
breaking v0.15.0: oxc-resolver changed from bundled dependency to peer dependency – must install manually.
fix Run 'npm install oxc-resolver' as an additional dependency.
breaking v0.14.0: oxc-resolver updated to ^8.0.0, major version bump may cause incompatibilities.
fix Ensure oxc-resolver version 8 is installed.
gotcha The resolver-next API (createOxcImportResolver) is only available for eslint-plugin-import-x >=4.5.0 with flat config.
fix Use the older resolver API for eslint-plugin-import-x <4.5.0 (settings['import-x/resolver'] = 'oxc').
gotcha bundlerConfig support for Vite, Rspack, Webpack is experimental and only works with the async createOxcImportResolver function.
fix Use await createOxcImportResolver({ bundlerConfig: 'vite.config.ts' }) in an async context.
npm install eslint-import-resolver-oxc
yarn add eslint-import-resolver-oxc
pnpm add eslint-import-resolver-oxc

Configure eslint-plugin-import-x with oxc resolver using flat config (ESM).

// eslint.config.js
import { createOxcImportResolver } from 'eslint-import-resolver-oxc'

export default [
  {
    settings: {
      'import-x/resolver-next': [
        createOxcImportResolver({
          conditionNames: ['node', 'import', 'require'],
          extensions: ['.js', '.mjs', '.cjs', '.jsx', '.ts', '.mts', '.cts', '.tsx', '.d.ts', '.d.mts', '.d.cts'],
        }),
      ],
    },
  },
]