No definition found when ts code is in a subfolder
See original GitHub issueHi there!
So I tried to installing atom and atom-typescript to see how it compares with Visual Studio / WebStorm for nodejs web projects. What I immediately noticed is that I’m getting Atom Ts: No definition found
.
“What the heck does this mean?” though I. Well after searching the issues here, it became apparent that this is because of missing tsconfig.json
. (Could the error message be improved? A user has no fighting chance dealing with this cryptic error message).
But the thing is, my tsconfig.json
was not missing. It was there all right. It was working perfectly in WebStorm. What I quickly realized is that atom-typescript expects tsconfig.json
at the project root.
I prefer to have all typescript files in a subfolder (as opposed to js, etc). Firstly I feel it’s cleaner. Secondly, from time to time ts files appear inside node_modules, and ts compiler (at least in webstorm) dutifully walks the whole tree and compile them. And then complains. I did not want that to happen so I moved all my TS in a subfolder, put there tsconfig.json
and it worked perfectly, but not in atom.
How do I configure atom-typescript so that it looks for tsconfig.json
in a different place and starts transpiling from that folder? Is it possible to improve the error message?
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (2 by maintainers)
Yeah, that looks like the issue
I was getting the same problem, but all I did was set “buildOnSave” from false to true, and restart the atom IDE. It was working fine with me without reinstalling.