Skip to content

Rule to enforce use of $props interface #1195

Description

@AntonioVentilii

Description

Would it be possible to have a rule that enforces the explicit declaration of Prop interface?

// BAD
let {
	inputValue = $bindable(''),
	disabled = false,
	icon,
	overflowableContent
}: {
	inputValue: string;
	disabled?: boolean;
	icon: Snippet;
	overflowableContent?: Snippet;
} = $props()

// GOOD
interface Props {
	inputValue: string;
	disabled?: boolean;
	icon: Snippet;
	overflowableContent?: Snippet;
}

let {
	inputValue = $bindable(''),
	disabled = false,
	icon,
	overflowableContent
}: Props = $props()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions