← All recipes
Moderne licensed

Find Dictionary/HashSet without StringComparer

Recipe IDOpenRewrite.Recipes.CSharp.CodeQuality.Style.FindUseStringComparerArtifactOpenRewrite.Recipes.CSharp.CodeQuality

Detect Dictionary<string, T> or HashSet<string> created without an explicit StringComparer. Use StringComparer.Ordinal or StringComparer.OrdinalIgnoreCase.

Single recipecsharpstylecode-qualityProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe OpenRewrite.Recipes.CSharp.CodeQuality.Style.FindUseStringComparer

If the recipe isn’t available locally, install it with:

mod config recipes nuget install OpenRewrite.Recipes.CSharp.CodeQuality