Skip to content

guzart/eslint-import-resolver-reactnative

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

React Native module resolution plugin for eslint-plugin-import.

Resources

License

Stars

Watchers

Forks

Packages

No packages published