Skip to contentSlop Block

prefer-type-alias

Warning

Declare object types with type. interface is allowed only inside declare module and declare global.

interface User {Declare $NAME with type instead of interface	id: string;}
export interface ButtonProps extends HTMLProps {Declare $NAME with type instead of interface	variant: "primary" | "secondary";}
// ast-grep-ignore: prefer-type-alias-typescript

How to fix

Write type $NAME = { ... }. Interfaces are allowed only inside declare module and declare global, where declaration merging needs them to augment existing types.