ide-typescript
ide-typescript copied to clipboard
imported node_modules packages not resolved if editor not opened at project root
So say a repository's root is at ~/project, meaning the following files exist (among others):
~/project/package.json
~/project/node_modules
~/project/src/index.ts
~/project/src/tsconfig.json
Opening the editor at atom ~/project/src will cause all imports targeting node modules to be marked as missing: "Cannot find module xxx". Typescript, though, has no problem resolving modules as expected,
cd ~/project/src
../node_modules/.bin/tsc # works just fine and transpiles files as expected
The result of running the commands above will be the creation of an index.js file with the appropriate imports as configured in tsconfig.json.