Problem
A type exported from a Vue component can be identified by VSCode properlym, but type aware linter complaints about it.
Reproduce Steps
- Create a new project refer to https://vuejs.org/guide/quick-start#creating-a-vue-application.
- In the
eslint.config.ts, change vueTsConfigs.recommended to vueTsConfigs.strictTypeChecked
- In the
App.vue, export a type.
<script setup lang="ts">
export interface Item {
value: string
num: number
}
</script>
- Create a file
test.ts.
import type { Item } from '@/App.vue'
const a: Item = { value: 'test', num: 123 }
const str = `This is a template string: ${a.value} and the number is: ${a.num}`
Expectation
Item.value is a string, so in TS file should not complainst about any type cannot be used in template literal expression.