vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 403 forks source link

vue-tsc: useCssModule() in script setup component breaks checking #4960

Closed tminich closed 3 weeks ago

tminich commented 3 weeks ago

Vue - Official extension or vue-tsc version

2.1.8

VSCode version

Vue version

2.7.16

TypeScript version

5.6.3

System Info

No response

package.json dependencies

No response

Steps to reproduce

Test.vue:

<template>
    <div/>
</template>

<script setup lang="ts">
    import {useCssModule} from 'vue'

    const $style = useCssModule()
</script>

<style module lang="scss">
    .test {
        color: rebeccapurple;
    }
</style>
vue-tsc --noEmit --skipLibCheck -w

What is expected?

No bogus issues found.

What is actually happening?

vue-tsc reports

resources/js/components/common/Test.vue:8:32 - error TS1005: ',' expected.

8     const $style = useCssModule()
                                 ~

resources/js/components/common/Test.vue:8:33 - error TS1109: Expression expected.

8     const $style = useCssModule()
                                  ~

Link to minimal reproduction

No response

Any additional comments?

Bug is new in 2.1.8, reverting to 2.1.6 fixes the issue.

KazariEX commented 3 weeks ago

Duplicate of #4951

tminich commented 3 weeks ago

Ah, sorry. I checked yesterday if this was known and forgot to check again today before reporting ^^'