Qatadah reported: Anas ibn Malik, may Allah be pleased with him, passed by a graveyard of Ramad while they were building a mosque over it. Anas said, “It is hated to build a mosque in the midst of graves.”
Source: Shu’ab al-Imān 2679
Grade: Sahih (authentic) according to Al-Albani
عَنْ قَتَادَةَ أَنَّ أَنَسَ بْنَ مَالِكٍ رضي الله عنه مَرَّ عَلَى مَقْبَرَةِ رَمَادٍ وَهُمْ يَبْنُونَ مَسْجِدًا فَقَالَ أَنَسٌ كَانَ يُكْرَهُ أَنْ يُبْنَى مَسْجِدٌ فِي وَسَطِ الْقُبُورِ
2679 شعب الإيمان الصلاة فصل المشي إلى المساجد
138 المحدث الألباني خلاصة حكم المحدث رجاله ثقات رجال الشيخين في أحكام الجنائز