Closed brandonccx closed 5 years ago
Can't reproduce, works well enough for me, with a caveat that changing resolveJsonModule
option apparently requires a restart of tsserver (hint: use typescript:restart-all-servers
command)
If restart doesn't help, then triple-check that the tsconfig.json
you're editing is indeed related to the project where you want to import JSON modules, and the TypeScript version that Atom is using. All of that information is accessible via Atom's status panel:
typescript:restart-all-servers
command makes it work properly, thank you so much, @lierdakil
According to the docs: https://www.typescriptlang.org/docs/handbook/compiler-options.html
I set
resolveJsonModule
andesModuleInterop
totrue
in mytsconfig.json
But atom still shows the type error:
Can't find module './xxxx.json'
.The ts complier can compile correctly and without error in cmd, if I remove the two options above, ts complier will also throw the error. It seems like the atom plugin doesn't support the "resolveJsonModule" option ?
I don't want to add a module declaration for JSON file since I use the typescript 3.0+, JSON imports has been supported via compilerOptions config.
Any one can help me? Thank you very much :)