ESLint Plugin Import Resolver React Native

raw JSON →
1.0.2 verified Sat Apr 25 auth: no javascript maintenance

React Native module resolution plugin for eslint-plugin-import (v1.0.2, last updated 2020). Uses eslint-import-resolver-node with modifications: adds .android.js and .ios.js extensions, resolves project name to root path. No breaking changes known; single stable release. Differentiates from standard resolver by supporting platform-specific file resolution and project-name-based imports.

error ESLint: Unable to resolve path to module 'cool-project/components/button'.
cause Plugin not configured in .eslintrc or package name mismatch.
fix
Set settings.import/resolver to 'reactnative' and ensure package.json name matches import prefix.
gotcha Requires eslint-plugin-import to be installed as a dev dependency.
fix Run: npm install --save-dev eslint-plugin-import
gotcha Does not automatically resolve node_modules; relies on eslint-import-resolver-node.
fix Ensure your project structure matches typical node resolution or add additional resolver.
gotcha Only works with eslint-plugin-import's resolver interface; other lint rules not affected.
fix Verify that import/export rules are enabled in .eslintrc.
npm install eslint-import-resolver-reactnative
yarn add eslint-import-resolver-reactnative
pnpm add eslint-import-resolver-reactnative

Configures ESLint to use the React Native resolver for module resolution.

// .eslintrc
{
  "settings": {
    "import/resolver": "reactnative"
  }
}