Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Typescript type-checking #25

Open
mosesoak opened this issue May 28, 2021 · 2 comments
Open

Feature request: Typescript type-checking #25

mosesoak opened this issue May 28, 2021 · 2 comments

Comments

@mosesoak
Copy link

Hi @clinyong thank you so much for this plugin. 👏 I found it after many frustrating hours trying to get Gatsby + Typescript to play well with scss modules, including gatsby-plugin-scss-typescript and typescript-plugin-css-modules. This plugin adds both code-completion and jump-to-class-definition, hooray! 😅

There are a few other issues and PRs open for absolute-path support and curly-brace module import support for styles, both things that our team would welcome!

There's also one feature that would make this really feel complete with Typescript: the ability to see an error on the class name if it's incorrect. For example, if you change a class name in the scss file, currently it does not show an error in VS Code on the lookup like className={styles.staleClass}.

I'm not sure if that would require the TS language plugin (typescript-plugin-css-modules) to make work, but at least for me I can't currently use that plugin with Gatsby 3 import * as styles syntax.

@clinyong
Copy link
Owner

clinyong commented Jun 2, 2021

Hi @mosesoak, I wrote this to solve my own css modules problem first, but so happy to see the plugin can help people like you. I'm sorry that I'm not maintaining this plugin well because of my busy work.

I will see the absolute-path PR this weekend, other issues maybe later. And about the type checking feature, I'm not sure I can solve it, but glad to have a try.

@mosesoak
Copy link
Author

mosesoak commented Jun 8, 2021

Sounds good, thanks @clinyong ! The author of the language plugin, @mrmckeb, made some fixes as well. He does have type-checking working, but hasn't gotten jump-to-definition nailed as you have, and also ran into issues with absolute paths. Maybe you two should put your heads together on a working solution for this! It would be neat if a vs code plugin like this could wrap the language plugin features to offer one solid way that VS Code users could get modules & typescript to play nicely together. Thanks again for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants