Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components props beginning with data* show TS error because of capitalization #1413

Closed
DrJume opened this issue Jun 7, 2022 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@DrJume
Copy link

DrJume commented Jun 7, 2022

Using a component with a prop named i.e. dataRows, using it in the template shows this TS error:

Type '{ "data-rows": IdRecordAny[]; }' is not assignable to type 'IntrinsicAttributes & Partial<{}> & Omit<Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{ dataRows: IdRecordAny[]; striped?: boolean | undefined; }>>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>'.
  Property 'dataRows' is missing in type '{ "data-rows": IdRecordAny[]; }' but required in type 'Omit<Readonly<ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{ dataRows: IdRecordAny[]; striped?: boolean | undefined; }>>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>'.

The error is only shown when passing the prop in kebab-case:
image

When passing it as camelCase the error is not shown, but ESLint wants to convert it back to kebab-case:
image

I suspect this commit for causing this regression: ba2835f

Defined component props beginning with data* or aria* should work in every capitalization like seen with other props.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants