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

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

argcast
Copy link

@argcast argcast commented Jun 23, 2024

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.

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

vercel bot commented Jun 23, 2024

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

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: redundant empty Interface for InputProps on input component
2 participants