"And there is no town but that We will destroy it," [17:58] He is threatening them with punishment, "that has been written in the Book," meaning: recorded.
﴿وَإِنْ مِنْ قَرْيَةٍ إِلا نَحْنُ مهلكوها﴾ (ل ١٨٦) يُخَوِّفُهُمْ بِالْعَذَابِ ﴿كَانَ ذَلِكَ فِي الْكتاب مسطورا﴾ أَي: مَكْتُوبًا.