Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

absolute paths with react-native raise eslint errors

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.

like image 267
maraujop Avatar asked Oct 13 '16 15:10

maraujop


Video Answer


1 Answers

Published a package to solve this issue

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

Let me know how it goes.

like image 170
guzart Avatar answered Oct 18 '22 23:10

guzart