Format JavaScript and JSX with Prettier — the same engine your editor uses, with no install.
Ctrl + Enter to run
Formatting parses to a syntax tree and prints it back, so the program is preserved by construction and only its layout changes. Consistent layout is what makes a diff show the change you made rather than a reflow of everything around it.
It runs Prettier itself, not a reimplementation, so the output matches your editor. The main use is code you did not write — a vendor snippet, a bundled file, something pasted from an issue thread — where restoring structure is the difference between reading it and guessing at it.