eslint-import-resolver-react-native

0.2.0 • Public • Published

eslint-import-resolver-react-native

eslint-plugin-import resolver for react-native that tries to resolve .ios.js and .android.js if import is not resolved, and also checks for @image extensions

Ex:

  • table.ios.js
  • table.ios.gif
  • table@3.5x.gif
  • table@3.5x.ios.gif

Install

npm i eslint-import-resolver-react-native --save-dev

.eslintrc

{
  ...
  settings: {
    "import/resolver": "react-native"
  }
  ...
}

Options

platform: 'both' || 'ios' || 'android' || 'any'
default = 'both'

'both' - .ios and .android file needs to be present to resolve
'any' - .ios and/or .android file needs to be present to resolve
'ios' - only looks for .ios files
'android' - only looks for .android files

{
  ...
  settings: {
    "import/resolver": {
      "react-native": {platform: 'ios'}
    }
  }
  ...
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    6,160
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    6,160
  • 0.1.1
    125
  • 0.1.0
    2
  • 0.0.1
    6

Package Sidebar

Install

npm i eslint-import-resolver-react-native

Weekly Downloads

6,293

Version

0.2.0

License

MIT

Unpacked Size

11.7 kB

Total Files

26

Last publish

Collaborators

  • leadinglight