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'}
    }
  }
  ...
}

Dependencies (1)

Dev Dependencies (3)

Package Sidebar

Install

npm i eslint-import-resolver-react-native

Weekly Downloads

3,267

Version

0.2.0

License

MIT

Unpacked Size

11.7 kB

Total Files

26

Last publish

Collaborators

  • leadinglight