[Bug Report] type checking doesn`t work
- Dominant language
- Vue
- Stars
- 54k
- Forks
- 14.4k
- PR merge metrics
- No merged PRs in 30d
Description
### Element UI version
2.13.1
### OS/Browsers version
electron@8.2.3
### Vue version
2.6.11
### Reproduction Link
https://github.com/ccforeverd/electron-tmp3
### Steps to reproduce
``` bash
vue create . # with typescript
vue add electron-builder
vue add element-ui
ncu -u
yarn
```
update `tsconfig.json`
``` json
{
"compilerOptions": {
...
"types": [
"webpack-env",
"element-ui",
"vuetify",
"jest"
],
"typeRoots": [
"./node_modules/element-ui/types"
],
...
}
}
```
add `src/components/TestElementUI.tsx`
``` tsx
import { Vue, Component } from 'vue-property-decorator'
import { Button } from 'element-ui'
@Component
export default class App extends Vue {
public text = 'main-app'
protected render (): JSX.Element {
return (
{this.text}
)
}
}
```
type `yarn electron:serve`
then throw error in editor and webpack output:
```
{
"resource": "/Users/zhangshuyao/Sites/electron/electron-tmp3/src/components/TestElementUI.tsx",
"owner": "typescript",
"code": "2769",
"severity": 8,
"message": "No overload matches this call.\n Overload 1 of 3, '(options?: ThisTypedComponentOptionsWithArrayProps | undefined): Button', gave the following error.\n 不能将类型“{ type: string; }”分配给类型“ThisTypedComponentOptionsWithArrayProps”。\n 类型“ThisTypedComponentOptionsWithArrayProps”上不存在属性“type”。\n Overload 2 of 3, '(options?: ThisTypedComponentOptionsWithRecordProps | undefined): Button', gave the following error.\n 不能将类型“{ type: string; }”分配给类型“ThisTypedComponentOptionsWithRecordProps”。\n 类型“ThisTypedComponentOptionsWithRecordProps”上不存在属性“type”。\n Overload 3 of 3, '(options?: ComponentOptions, DefaultMethods, DefaultComputed, PropsDefinition>, Record<...>> | undefined): Button', gave the following error.\n 不能将类型“{ type: string; }”分配给类型“ComponentOptions, DefaultMethods, DefaultComputed, PropsDefinition>, Record<...>>”。\n 类型“ComponentOptions, DefaultMethods, DefaultComputed, PropsDefinition>, Record<...>>”上不存在属性“type”。",
"source": "ts",
"startLineNumber": 14,
"startColumn": 17,
"endLineNumber": 14,
"endColumn": 21
}
```
### What is Expected?
no error
### What is actually happening?
throw error in editor and webpack output:
```
{
"resource": "/Users/zhangshuyao/Sites/electron/electron-tmp3/src/components/TestElementUI.tsx",
"owner": "typescript",
"code": "2769",
"severity": 8,
"message": "No overload matches this call.\n Overload 1 of 3, '(options?: ThisTypedComponentOptionsWithArrayProps | undefined): Button', gave the following error.\n 不能将类型“{ type: string; }”分配给类型“ThisTypedComponentOptionsWithArrayProps”。\n 类型“ThisTypedComponentOptionsWithArrayProps”上不存在属性“type”。\n Overload 2 of 3, '(options?: ThisTypedComponentOptionsWithRecordProps | undefined): Button', gave the following error.\n 不能将类型“{ type: string; }”分配给类型“ThisTypedComponentOptionsWithRecordProps”。\n 类型“ThisTypedComponentOptionsWithRecordProps”上不存在属性“type”。\n Overload 3 of 3, '(options?: ComponentOptions, DefaultMethods, DefaultComputed, PropsDefinition>, Record<...>> | undefined): Button', gave the following error.\n 不能将类型“{ type: string; }”分配给类型“ComponentOptions, DefaultMethods, DefaultComputed, PropsDefinition>, Record<...>>”。\n 类型“ComponentOptions, DefaultMethods, DefaultComputed, PropsDefinition>, Record<...>>”上不存在属性“type”。",
"source": "ts",
"startLineNumber": 14,
"startColumn": 17,
"endLineNumber": 14,
"endColumn": 21
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.