You are viewing the documentation for the develop branch. The documentation for the release version is here .

Table of Contents

import-js layer

Table of ContentsClose

1. Description

This layer adds support for import-js

1.1. Features:

  • Import Javascript/Typescript modules to buffer
  • Import missing modules and remove unused one
  • Go to module location

2. Install

To use this configuration layer, add it to your ~/.spacemacs.

To install import-js globally:

$ npm install -g import-js

If that doesn't work you can also try installing import-js with --unsafe-perm tag

$ sudo npm install --unsafe-perm -g import-js

To enable it, set the layer variable javascript-import-tool, for example for the javascript layer

(javascript :variables javascript-import-tool 'import-js)

Once you have set this variable other layers react and typescript will also enjoy this feature

3. Key bindings

Key binding Description
SPC m i i Import the module for the variable under the cursor
SPC m i f Import any missing modules and remove any modules that are not used
SPC m i g Go to the module of the variable under cursor

Author: root

Created: 2022-05-24 Tue 11:52