Better JavaScript layer for Spacemacs.
This layer adds improvements for Spacemacs javascript layer.
- Auto-import feature using import-js
- Flow support by flow-minor-mode
- Formatting with prettier and eslint_d.js
To use this configuration layer, add it to your ~/.spacemacs. You will need to add better-javascript to the existing dotspacemacs-configuration-layers list in this file.
You will also need to install flow-bin and flow-coverage-report to use the Flow language:
$ npm install -g flow-bin flow-coverage-reportTo use the auto-import feature, install import-js:
$ npm install -g import-jsTo use the formatting features, install prettier and eslint-cli (eslint_d is preferred for performance):
$ npm install -g prettier eslint-cli eslint_dTo activate error checking using flycheck, install eslint-cli (eslint_d is preferred for performance):
$ npm install -g eslint-cli eslint_d| Key Binding | Description |
|---|---|
SPC i i |
import the module for the variable under the cursor |
SPC i f |
import any missing modules and remove any modules that are not used |
SPC i g |
go to the module of the variable under the cursor |
| Key Binding | Description |
|---|---|
SPC m = |
format code in Prettier, ESLint |