1.0.3 • Published 8 years ago
eslint-import-resolver-ejoyreactnative v1.0.3
eslint-import-resolver-reactnative
React Native module resolution plugin for eslint-plugin-import.
Uses eslint-import-resolver-node with a few modifications:
- Configures extensions for React Native
['.js', '.json', '.android.js', '.ios.js'] - Helps resolve project name paths to the root (
eslint-plugin-import#626)
Usage
npm install --save-dev eslint-import-resolver-reactnativeConfigure ESLint to use this plugin.
// .eslintrc
settings:
import/resolver: reactnativeUse your project's name as part of the import path.
// package.json
{
"name": "cool-project"
}import Button from 'cool-project/components/button';
// imports a file located at <PROJECT_ROOT>/components/button.js (or button.android.js or button.ios.js)
// ...Notice that this plugin will resolve your project's name to your project's root folder.