0

New to react native and trying to setup ESLint in my project. I am getting this specific error:

Unable to resolve path to module 'react-native'. (import/no-unresolved)

I searched on SO and found similar threads, but nothing seems to work. I tried cleaning the npm cache as well.

import { AppRegistry } from 'react-native';

There is a red underline on my index.js file in the project root (using Atom editor) and under the word react in the above code snippet.

user1669296
  • 425
  • 1
  • 6
  • 13
  • the most common solution? ignore it. every linter is going to have issues with pathing – Kai Feb 06 '19 at 19:54

1 Answers1

0

As per the react native guide

AppRegistry should be required early in the require sequence to make sure the JS execution environment is setup before other modules are required.

If you are struggling with es-lint configuration and guess that it's showing false error then you can add .eslinrc file at the root of the project and configure eslint rule as required. I suggest airbnb standard, this guide show full setup here

mhnpd
  • 381
  • 2
  • 11