Open ProfDoof opened 11 months ago
I must admit I don't fully grok the tsconfig file, I've been experimenting my wag through it. If you have a recommended change I'd be happy to include it.
I'm pretty much in the same boat. Let me get another friend of mine in here who works with TS and JS more often than I do. XD
https://github.com/retorquere/generator-zotero-plugin/blob/2ea55de163dcce039db9c7950ea8323f332ab67b/app/tsconfig.json#L19-L24
This may be because I'm not as familiar with the
tsconfig.json
or my LSP not working correctly, but when thetsconfig.json
exclude
s thenode_modules
folder, it excludes thezotero-types
folder as well. I believe that's because according to https://www.typescriptlang.org/tsconfig#exclude, the exclude only excludes things that are matched by include and that match the pattern. It almost seems like a filter function on top of include rather than excluding everything except for what's included like what I would expect.This causes my LSP to not be able to find the
zotero-types
type declarations and the need todeclare const Zotero: any
at the top which isn't needed when I get rid of the line excluding thenode_modules
folder. When I use the followingtsconfig.json
, I no longer getCannot find name 'Zotero'. (2304)
in mylib.ts
file.tsconfig.json
even with my
lib.ts
looking like this without declaring the const at the top.lib.ts