“The Messenger of Allah (ﷺ) said: ‘Make your rows straight, for straightening the rows is part of completing the prayer.’”
Sunan Ibn Majah Book 5, Hadith 191