Ah, I think I understand now why there seems to be no answer to this question:
The line numbers ARE displayed — but only when the JS editor is open or has focus.
As soon as you use the cursor for another task, the line numbers disappear and only the JS code is displayed.
In my opinion, it would be better or “nicer” if the line numbers remained visible at all times.
But the current solution is also OK for me. My only concern was that I could find the line numbers of problems that the console throws up.
The fact that you have to switch to the editor to do this is not ideal, but it's OK.