ds300 / react-native-typescript-transformer

Seamlessly use TypeScript with React Native
MIT License
657 stars 50 forks source link

fix(tsconfig): use find-root to find the nearest tsconfig.json #54

Closed ali-hk closed 6 years ago

ali-hk commented 6 years ago

app-root-path relies on its own install location to determine the root of the project. however, when using yarn workspaces, this assumption is incorrect. this results in either not finding a tsconfig.json or finding a tsconfig.json that has been extended. find-root allows passing a starting location and predicate and searches recursively up.

ali-hk commented 6 years ago

See https://github.com/ali-hk/typescript-yarn-monorepo/tree/use-yarn-nohoist/ts-yarn-monorepo/packages/native for an example that repros the issue. Not that you'll need to change package.json to remove the TSCONFIG_PATH environment variable workaround from afcd5ef6209333d09e39379a9a217ad25a8e14c4.

ds300 commented 6 years ago

HI! Thanks for this PR! This seems sensible. I'm going to test it now 👍

ds300 commented 6 years ago

All good, published in 1.2.4 :tada:

Thanks again! ❤️