Traced to Su Shi (苏轼, Song dynasty) in 《题王逸少帖》: '出林飞鸟一扫空' — birds leaving the forest sweep the sky clean. The phrase later generalized to wiping anything out wholesale.
usage
Often used with 把 + object (把…一扫而光). Works for food eaten up, doubts dispelled, enemies defeated, or bad moods lifted — anything that can be 'swept away'.