Skip to content

Commit

Permalink
fix(language-core): generate style modules type as needed (#4953)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX authored Oct 30, 2024
1 parent 5467277 commit 1ef17d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function* generateStyleModulesType(
ctx: ScriptCodegenContext
): Generator<Code> {
const styles = options.sfc.styles.map((style, i) => [style, i] as const).filter(([style]) => style.module);
if (!styles.length) {
if (!styles.length && !options.scriptSetupRanges?.cssModules.length) {
return;
}
yield `type __VLS_StyleModules = {${newLine}`;
Expand Down
6 changes: 6 additions & 0 deletions test-workspace/tsc/passedFixtures/vue3/cssModule/empty.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script lang="ts" setup>
import { useCssModule } from 'vue';
// @ts-expect-error
useCssModule();
</script>

0 comments on commit 1ef17d0

Please sign in to comment.