Emacs plugin for ImportJS
importjs
binary:npm install import-js -g
(require 'import-js)
to your config. You will also need to install
grizzl
(M-x) run-import-js
You can use something like (M-x) import-js-import
with your cursor over
the desired module
It will be helpful to bind import-js-import
to an easy-to-use binding,
such as:
(define-prefix-command 'my-keymap)
(global-set-key (kbd "s-a") 'my-keymap)
(define-key my-keymap (kbd "a u") 'import-js-import)
(M-x) import-js-goto
will jump to the appropriate file found by ImportJS(global-set-key (kbd "<f4>") 'import-js-goto)
eslint
must be in your PATH.(M-x) import-js-fix
import-js-fix
to run on save:
(add-hook 'after-save-hook 'import-js-fix)
I've had issues running import-js in Emacs on Node v6.1.0. Node >= v6.2.0 seems to work as expected.