While implementing the accepted answer, I've found a better solution - consider using the import/no-duplicates rule from eslint-plugin-import.
import/no-duplicates
eslint-plugin-import
It not only detects duplicate imports but also provides auto-fixing to merge them effectively.