7

in my React Native app, within my package.json I've set the name to rpms. This allows me to do:

import Component from 'rpms/App/common/Component'

Flow gets on well with this type of imports, however eslint-plugin-import raises import/no-extraneous-dependencies, and import/no-unresolved. I've added to my rules:

"import/no-unresolved": [2, { "ignore": ["rpms"] }],

And that way I disconnect import/no-unresolved. To disable the other I've tried with:

"settings": {
  "import/ignore": ["rpms"]
},

However it's not working. However, I have the feeling, that maybe ignoring these errors is not the right way to go.

maraujop
  • 4,472
  • 2
  • 36
  • 40
  • Were you able to resolve this? I just started an issue [over on GitHub](https://github.com/benmosher/eslint-plugin-import/issues/626). – willlma Oct 15 '16 at 14:19
  • No, I'm now following your Github issue, looks like support is missing. However I'm extending airbnb eslint config and it works for them, weird – maraujop Oct 18 '16 at 09:21

1 Answers1

3

Published a package to solve this issue

https://www.npmjs.com/package/eslint-import-resolver-reactnative

Let me know how it goes.

guzart
  • 3,700
  • 28
  • 23
  • I opened a PR some days before you proposing to adjust node resolver to handle RN absolute imports, but it was closed in favor of your standalone resolver. https://github.com/benmosher/eslint-plugin-import/pull/638 so I'm accepting this as the answer to the question. I would add a little section in your README on how to set the resolver in eslint settings – maraujop Nov 15 '16 at 11:47