Closed Zarel closed 6 years ago
...never mind, I figured it out.
(punishments.js
was being required by dev-tools/globals.ts
)
(On third thought, commenting out the relevant line of dev-tools/globals.ts
doesn't make the error disappear, either; I'm confused again.)
The compiler picks up imports from your files, not just include/exclude, see https://github.com/Microsoft/TypeScript/wiki/FAQ#why-is-a-file-in-the-exclude-list-still-picked-up-by-the-compiler
Yes, but if I remove the import, it's still giving the same error message.
...okay, it's working now. There was a stray input elsewhere.
...I'm still unclear on what's making the error message appear. It would probably be useful to be able to ask TypeScript what file is importing the file.
I was able to discover that chat-commands
is importing punishments
(and removing that import suppresses that error), but not what's importing chat-commands
...I'm still unclear on what's making the error message appear. It would probably be useful to be able to ask TypeScript what file is importing the file.
use tsc --listFiles
to know what files are included in your compilation, and tsc --traceResolution
to know why they were included.
Thanks!
TypeScript Version: 2.6.1, 2.7.0-dev.201xxxxx
Code
Unfortunately, this error disappears when I try to construct a simple self-contained test-case (most TypeScript errors I encounter work like this, which makes debugging them really weird).
But you can reproduce this with:
Expected behavior:
No errors
Actual behavior:
This is unexpected because
punishments.js
is explicitly not one of the files included in"include"
intsconfig.json
. Even explicitly adding"exclude": ["punishments.js"]
doesn't make the error disappear.I thought maybe I was using the wrong syntax? But when I copied the
tsconfig.json
to a new project, suddenly the"include"
setting was being respected again (this is what I mean by "this error disappears when I try to construct a simple self-contained test-case").