You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to see a type error if we make a typo in a class name when using CSS modules. Currently the type for useCssModule() is defined like Record<string, string> & { class1: string, ... }, would it be possible to remove the Record and just have it be of type { class1: string, ... }? Perhaps this could be added with a TS config option to enable it, similar to strictTemplates etc?
What does the proposed solution look like?
<script setup>
const { wrongClass } =useCssModule()/// ^ Error: Property 'wrongClass' does not exist on type
</script>
<style module>
.class1 { color: red }
</style>
The text was updated successfully, but these errors were encountered:
What problem does this feature solve?
It would be nice to see a type error if we make a typo in a class name when using CSS modules. Currently the type for
useCssModule()
is defined likeRecord<string, string> & { class1: string, ... }
, would it be possible to remove theRecord
and just have it be of type{ class1: string, ... }
? Perhaps this could be added with a TS config option to enable it, similar to strictTemplates etc?What does the proposed solution look like?
The text was updated successfully, but these errors were encountered: