typescript-plugin-css-modules
typescript-plugin-css-modules copied to clipboard
Does not work in VSCode and a common SvelteKit project.
I assume that this is related to #212 but I wasn't able to get it to work in normal .ts files either so I'm creating a new issue.
Here is the reproduction: https://github.com/enyo/typescript-css-modules-demo
There are only 2 commits:
- The first commit after doing
npm create svelte@latest my-app - My changes that add
typescript-plugin-css-modulesand show that there is no intellisense.
I'm pretty sure that this is due to https://github.com/sveltejs/language-tools/issues/905
So I guess that this plugin can't do anything about it.
Maybe it's worth adding a note with a link to the issue to the README so svelte users don't need to bang their head against the table?
It should work in ts/js files. You probably missed this section in the README https://github.com/mrmckeb/typescript-plugin-css-modules?tab=readme-ov-file#visual-studio-code. That's the first problem I encounter when opening your reproduction.
And for svelte files, it's explained in the issue you linked. The object needed for the language service plugin simply doesn't exist in the Svelte language server. I'll reply to the comment you asked in that issue. It also won't work in the +page.ts + +layout.ts files in a SvelteKit project because of the way zero-config type-safety was implemented in the typescript-svelte-plugin(not to be confused with the vscode extension or the svelte language server). So this is not something that can be fixed in typescript-plugin-css-modules.