Skip to content

[Blazor] IDisposable Sanity check on Blazor Component #51714

@naice

Description

@naice

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

We just faced the Issue that a Developer has probably copy and pasted component code including the public void Dispose() function but he forgot the @implements IDisposable

I have written a unit test that now detects such components, I wonder if it might be a smart idea to introduce a warning for that?

Describe the solution you'd like

A build generated warning or somthing similar that warns about components that expose a Dispose function but actually are not assignable to IDisposable.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzerIndicates an issue which is related to analyzer experiencearea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing one

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions