"Cleaning up" and "minifying" JS/CSS code can sound similar, but they're actually opposite operations.
Formatting โ for human readability
This adds line breaks and indentation around braces and semicolons so the code's structure is easy to scan. It's what you need when debugging a minified one-liner or reviewing someone else's code.
Minifying โ to shrink file size
This strips out comments, unnecessary whitespace, and line breaks to reduce file size. Shipping minified JS/CSS to production is standard practice, since it cuts network transfer size and improves load time.
The practical workflow
Work with formatted, readable code during development, then minify as part of the build step right before deployment. When an error shows up in minified code, the usual move is to reformat it, find the cause, and fix it there.