Skip to content

Instantly share code, notes, and snippets.

@kurnakovv
Last active November 15, 2025 06:00
Show Gist options
  • Select an option

  • Save kurnakovv/1d3a3421a7149e9040547b8c8bc1a4bb to your computer and use it in GitHub Desktop.

Select an option

Save kurnakovv/1d3a3421a7149e9040547b8c8bc1a4bb to your computer and use it in GitHub Desktop.
All IDisposableAnalyzers rules in .editorconfig
##
## IDisposableAnalyzers rules
##
# All rules here https://github.com/DotNetAnalyzers/IDisposableAnalyzers
dotnet_diagnostic.IDISP001.severity = suggestion # Dispose created
dotnet_diagnostic.IDISP002.severity = suggestion # Dispose member
dotnet_diagnostic.IDISP003.severity = suggestion # Dispose previous before re-assigning
dotnet_diagnostic.IDISP004.severity = suggestion # Don't ignore created IDisposable
dotnet_diagnostic.IDISP005.severity = suggestion # Return type should indicate that the value should be disposed
dotnet_diagnostic.IDISP006.severity = suggestion # Implement IDisposable
dotnet_diagnostic.IDISP007.severity = suggestion # Don't dispose injected
dotnet_diagnostic.IDISP008.severity = suggestion # Don't assign member with injected and created disposables
dotnet_diagnostic.IDISP009.severity = suggestion # Add IDisposable interface
dotnet_diagnostic.IDISP010.severity = suggestion # Call base.Dispose(disposing)
dotnet_diagnostic.IDISP011.severity = suggestion # Don't return disposed instance
dotnet_diagnostic.IDISP012.severity = suggestion # Property should not return created disposable
dotnet_diagnostic.IDISP013.severity = suggestion # Await in using
dotnet_diagnostic.IDISP014.severity = suggestion # Use a single instance of HttpClient
dotnet_diagnostic.IDISP015.severity = suggestion # Member should not return created and cached instance
dotnet_diagnostic.IDISP016.severity = suggestion # Don't use disposed instance
dotnet_diagnostic.IDISP017.severity = suggestion # Prefer using
dotnet_diagnostic.IDISP018.severity = suggestion # Call SuppressFinalize
dotnet_diagnostic.IDISP019.severity = suggestion # Call SuppressFinalize
dotnet_diagnostic.IDISP020.severity = suggestion # Call SuppressFinalize(this)
dotnet_diagnostic.IDISP021.severity = suggestion # Call this.Dispose(true)
dotnet_diagnostic.IDISP022.severity = suggestion # Call this.Dispose(false)
dotnet_diagnostic.IDISP023.severity = suggestion # Don't use reference types in finalizer context
dotnet_diagnostic.IDISP024.severity = suggestion # Don't call GC.SuppressFinalize(this) when the type is sealed and has no finalizer
dotnet_diagnostic.IDISP025.severity = suggestion # Class with no virtual dispose method should be sealed
dotnet_diagnostic.IDISP026.severity = suggestion # Class with no virtual DisposeAsyncCore method should be sealed
## **END** IDisposableAnalyzers rules **END**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment