Typescript i18n with JSON file doesn't work
XavierChevalier opened this issue · 6 comments
Following the documentation to the letter, typing with a JSON file does not work for me. No autocompletion is proposed.
I added the definition file with the import of my JSON, I made the dependency injection with the setI18n
method. I also have the option resolveJsonModule
to true
.
An idea ?
Can you provide an repo, it makes it easier to check the whole setup :)
Of course, you will find a minimal repository reproducing the error here: https://github.com/XavierChevalier/vue-composable-i18n-autocompletion
The declaration file is here: https://github.com/XavierChevalier/vue-composable-i18n-autocompletion/blob/master/src/config/types/shims-i18n.d.ts
For information, I use PhpStorm 2020.2.1
.
Build #PS-202.6948.87, built on August 27, 2020
.
Vetur seems to be a package for VSCode isn't it?
And yes, I confirm that suffixing as
with a TypeScript object typing works well!
I have no experience with PHPStorm, but it should work, the way they resolve the typing is different, but if they use typescript language server it should work.
Can you please confirm if the types works on a typescript file?
I'll be closing this due to inactivity, the typing is working on typescript projects (vscode), phpstorm, webstorm and other editors, should be using typescrip language server, if they do and with the correct configuration (using json
If you still need some help, reply or open a new issue :)