JavaScript

Install Syntax Highlighting

:TSInstall javascript
1

Install Language Server

JavaScript uses TypeScript language server.

Formatters

The configured formatter(s) must be installed separately.

Configuration in ~/.config/lvim/config.lua:

-- exe value can be "prettier", "prettierd", "eslint", or "eslint_d"
lvim.lang.javascript.formatters = { { exe = "prettier" } }
lvim.lang.javascriptreact.formatters = lvim.lang.javascript.formatters
1
2
3

Also combination of some prettier and eslint can be specified:

-- exe value can be "prettier", "prettierd", "eslint", or "eslint_d"
lvim.lang.javascript.formatters = { { exe = "eslint"}, { exe = "prettier" } }
lvim.lang.javascriptreact.formatters = lvim.lang.javascript.formatters
1
2
3

With eslint and eslint_d, the --fix functionality is used for formatting.

Linters

The configured linter must be installed separately.

Configuration in ~/.config/lvim/config.lua:

-- exe value can be "eslint" or "eslint_d"
lvim.lang.javascript.linters = { { exe = "eslint" } }
lvim.lang.javascriptreact.linters = lvim.lang.javascript.linters
1
2
3

LSP Settings

More information in TypeScript.

Debugger

(TODO)