Use LINQ Index()

Proprietary

Replace collection.Select((item, index) => (index, item)) with collection.Index(). Available since .NET 9.

OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.UseLinqIndex
mod run . --recipe=OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net9.UseLinqIndex

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.