Eslint-plugin-import: React native absolute path imports

Created on 15 Oct 2016  路  4Comments  路  Source: benmosher/eslint-plugin-import

Having the same issue as this Stackoverflow Question

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'

[鈥 eslint-plugin-import raises [鈥 import/no-unresolved.

resolver

Most helpful comment

You need to create a resolver for React Native.

All 4 comments

You need to create a resolver for React Native.

Just publish a package that piggy backs on eslint-import-resolver-node, hope this helps

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

oo, thanks @guzart!

You can use absolute paths like in this article

https://medium.com/better-programming/using-absolute-paths-in-react-native-3be369244fb1

I hope you found this piece useful.

Was this page helpful?
0 / 5 - 0 ratings