Skip to content

VueJS 3.5 TSX emits types broken #11803

@tcastelly

Description

@tcastelly

Vue version

3.5

Link to minimal reproduction

https://github.com/shenron/vite-demo/tree/vue-3.5

Steps to reproduce

npm run lint

TSX and events

Previously the emit property in the defineComponent enable in TSX a property with the same name prefixed by on

export const emits = {
  customClick /* <-- */: (args: string) => typeof args === 'string',
} as const;

export default defineComponent({
  name: 'HelloWorld',
  inheritAttrs: false,
  props,
  emits,
  setup,
  render,
});
<HelloWorld
  onCustomClick={console.log} /* <-  'onCustomClick' does not exist on type 'IntrinsicAttributes & Partial<{ rea .... */
/>

use case: https://github.com/shenron/vite-demo/blob/vue-3.5/src/app/useRender.tsx#L40

What is expected?

Same behavior as the previous version of Vue

What is actually happening?

Few false positive errors are trigger

System Info

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions