eslint-import-resolver-ejoyreactnative

1.0.3 • Public • Published

eslint-import-resolver-reactnative

npm

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-reactnative

Configure ESLint to use this plugin.

// .eslintrc
settings:
  import/resolver: reactnative

Use 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.

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-import-resolver-ejoyreactnative

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • toanz