-
-
Notifications
You must be signed in to change notification settings - Fork 500
Description
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 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>PindaPixel and GeoffreyParrier
Metadata
Metadata
Assignees
Labels
No labels