ui icon indicating copy to clipboard operation
ui copied to clipboard

(fix) - input(inputProps) @typescript-eslint/no-empty-interface

Open argcast opened this issue 1 year ago • 1 comments

Fixes #4083

An interface declaring no members is equivalent to its supertype.eslint@typescript-eslint/no-empty-interface.

The issue in the code is due to the InputProps interface extending React.InputHTMLAttributes<HTMLInputElement> without adding any new members. This is flagged by the ESLint rule @typescript-eslint/no-empty-interface, which indicates that an interface declaring no members is equivalent to its supertype.

By changing the InputProps interface to a type alias: export type InputProps = React.InputHTMLAttribute <HTMLInputElement>

By using a type alias instead of an interface, the code directly assigns InputProps to React.InputHTMLAttributes<HTMLInputElement> and avoids the ESLint warning about empty interfaces, as the type alias does not have the same issue.

argcast avatar Jun 23 '24 22:06 argcast

@argcast is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jun 23 '24 22:06 vercel[bot]

@argcast if it's okay, I'd like to close this in favor of https://github.com/shadcn-ui/ui/pull/5657 which addresses the other instances as well. Feel free to reopen if you have any question.

shadcn avatar Nov 08 '24 11:11 shadcn