Sayyiduna Anas (may Allah be pleased with him) used to regard it as disliked that a mosque be built between graves.