Use first() instead of get(0)
Proprietaryfirst() reads more naturally than get(0) and gives the same compile-time bounds guarantees — both throw NoSuchElementException/IndexOutOfBoundsException on an empty list.
org. openrewrite. kotlin. bestpractices. UseFirstForGetZero$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. bestpractices. UseFirstForGetZero$KtRecipe'Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.