RealOrangeOne / react-native-mock

A fully mocked and test-friendly version of react native (maintainers wanted)
MIT License
570 stars 153 forks source link

Should `babel-preset-airbnb` be in `dependencies`? #148

Closed sdeleon28 closed 6 years ago

sdeleon28 commented 6 years ago

I'm trying the master branch of the project directly from github to work around #139. When I run jest I get Couldn't find preset "airbnb" relative to directory "/path/to/project/node_modules/react-native-mock".

Should this dependency be in dependencies instead of devDependencies so that it gets installed when react-native-mock is installed via npm/yarn? Why does this even fail at runtime? Shouldn't all babel-related stuff be done with after build?

sdeleon28 commented 6 years ago

I've realized this is only a problem because I yarnd the lib directly from GitHub (because I needed to use master). Jest was diving into node_modules and transpiling modules in place. Since there was a .babelrc file in there, it tried to use it. This shouldn't happen via standard npm installs because the .babelrc is properly ignored in .npmignore.