[Typescript] defining components and props results in "Unsafe assignment of an any value"
Version
3.0.5
Reproduction link
https://github.com/susnux/eslint-typescript-issue
Steps to reproduce
yarn install
yarn lint
What is expected?
No lint error.
What is actually happening?
src/App.vue
12:33 error Unsafe assignment of an any value @typescript-eslint/no-unsafe-assignment
No sure if this is a vue-next error or a typescript-eslint error.
If you do not set components (e.g. components: undefined
, see comment in App.vue) props work as expected.
You need to add a declaration file:
// shims.d.ts
declare module '*.vue' {
import { ComponentOptions } from 'vue'
const component: ComponentOptions
export default component
}
@susnux you need the shims and I think it's valuable to add to https://v3.vuejs.org/guide/typescript-support.htmlin the docs-next repository