I just noticed that
(define-key js2-mode-map [return] #'js2-enter-key)
(use-local-map js2-mode-map)
overrides
(define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol)
even though viper-vi-basic-map is managed in `emulation-mode-map-alists'.
I mean that when I type RET I get js2-enter-key, not viper-next-line-at-bol.
Something is obviously wrong - somewhere, but where?
js2 should probably not bind `return' but "\C-m".
By binding `return' it asks Emacs to distinguish `return' from C-m.
Of course under ttys `return' doesn't exist, only C-m does so js2's
binding won't work there.