Closed
Description
Version
2.7.4
Reproduction link
Steps to reproduce
look at the example repo, or, install vue@2.7.4
and add type augmentation:
// env.d.ts
declare module "vue/types/vue" {
interface Vue {
$t: (s: string) => string
}
}
// broken-augment.ts
import {defineComponent} from "vue";
export default defineComponent({
methods: {
getTranslatedText() {
return this.$t("hello.vue");
},
},
});
What is expected?
Expected no erros.
What is actually happening?
> pnpm vue-tsc
src/broken-augment.ts:6:14 - error TS2571: Object is of type 'unknown'.
6 return this.$t("hello.vue");
~~~~~~~
Found 1 error in src/broken-augment.ts:6
Metadata
Metadata
Assignees
Labels
No labels