The app shouldn't quit until it has no windows open *and* is backgrounded
This is the behavior of, e.g., Preview and TextEdit.
Now that I look, Electron doesn't seem to have a way to check whether the app is foregrounded, only whether particular windows are.
Does this conflict with the App Menu, Quit behavior that is the traditional close method? Or is this alongside?
No, no conflict. See the behavior of TextEdit as an example.
Not sure if this is what is being suggested, but I don't think the app should quit at all until the user explicitly quits it by pressing Command-Q or clicking the Quit menu item. It's handy for the app icon to be always present in the Dock so you can drag game files onto it.
I am following the Mac UI guidelines here. If you want the app to be present in the Dock, MacOS has a "Keep in Dock" option (or you can drag the icon there); then it will be present whether the app is running or not.
Now that you've reminded me, I'm pretty sure Electron has this feature now, so I can implement this...
I am following the Mac UI guidelines here. If you want the app to be present in the Dock, MacOS has a "Keep in Dock" option (or you can drag the icon there); then it will be present whether the app is running or not.
TextEdit stays in the Dock even when there aren't any TextEdit windows open and even if you haven't checked "Keep in Dock". It only disappears from the Dock when you explicitly quit it.
It varies upon document vs window behaviour. In this decision, tabs are treated as documents within a window. macOS has traditionally SDI-oriented, however modern Mac OSes have moved away to be more Windows-like.
If an application has only one window ever, and that window contains one or more documents, closing the window should prompt to close the application. This is the System Preferences, dialogue, Windows-style behaviour. This is confusingly enough the MDI pattern.
If the application can or has open multiple windows which have arbitrary numbers of documents or tabs inside the window (SDI), then the preference is to leave the application running even when all windows are closed until explicitly closing the application. See this in Apple's text and word processing, XCode, and web browsers.
TextEdit stays in the Dock even when there aren't any TextEdit windows open and even if you haven't checked "Keep in Dock". It only disappears from the Dock when you explicitly quit it.
That's not what I see. TextEdit, Pages, and Numbers all have the behavior I described above. So does Xcode. Safari does not. (Catalina 10.15.6.)
Maybe this is the result of a preference I have set, but if so, I don't know what it is.
(Turns out Electron doesn't give any way to tell whether your app is backgrounded, so there's no way to proceed with this anyhow.)
To be really picky, I have to admit that those applications (TextEdit, etc) disappear from the Dock but their process is still active. They might as well be shut down from the user's point of view, however.
@erkyrath: These settings are set in General pane of System Preferences, but do not seem to replicate what you are describing. I honestly have no idea how that works for you — for me, an application stays in the Dock as long as it's open, and with most applications, closing windows does not close the applications. Further, with very few exceptions (applications set with Hide property) if the main executable of the application is running, it is in the Dock.

It's a good quality of life issue, but not a requirement.