Files
doomemacs/modules/lang/javascript
Henrik Lissner 1dae2bf916 fix(tree-sitter): remap to ts-mode w/o base mode
If the base major mode doesn't exist, let's assume we want no
fallthrough for this major mode (in the event the grammar isn't ready)
and simply push forward anyway, even if a missing grammar results in a
broken state.

This will particularly affect major modes like `typescript-mode` (which
simply won't be installed if +tree-sitter is enabled) and
`go-{mod,work}-ts-mode` (for which no base major modes exist).

The difference (generally) between most base and ts-modes is
performance, not features, so "gracefully failing back to the base mode"
makes sense UX-wise, but `typescript-mode` notably inferior to
`typescript-ts-mode` (particularly in its TSX support). Beginners may
misidentify its shortcomings as bugs, so it's better to simply error out
early so the user can be made aware of the problem sooner and less
ambiguously.
2025-08-31 16:20:14 +02:00
..
2024-09-14 20:47:39 -04:00
2025-08-31 14:39:38 +02:00

:lang javascript

Description   unfold

This module adds JavaScript and TypeScript support to Doom Emacs.

  • JSX/TSX support (requires doom-module:+tree-sitter and Emacs 29.1+)
  • LSP Integration

    • Code completion (with doom-module::completion corfu (recommended) or doom-module::completion company)
    • Syntax checking (with doom-module::checkers syntax)
    • Jump-to-definitions and references support
  • Code formatting (with doom-module::editor format and prettier)
  • REPL support (with doom-package:nodejs-repl and/or doom-module::tools eval)

Module flags

+lsp
Enable LSP support for js-mode, js-ts-mode, typesript-mode, and ~typescript-ts-mode. Requires doom-module::tools lsp and a langserver (supports ts-ls and deno-ls).
+tree-sitter
Leverages tree-sitter for better syntax highlighting and structural text editing. Requires doom-module::tools tree-sitter. Requires Emacs 29.1+. Required for JSX/TSX support.

TODO Hacks

󱌣 This module's hacks haven't been documented yet. Document them?

TODO Changelog

This module does not have a changelog yet.

Installation

Enable this module in your doom! block.

This module requires NodeJS and one of NPM or Yarn in your $PATH.

  • MacOS: $ brew install node
  • Arch Linux: $ pacman --needed --noconfirm -S nodejs npm
  • openSUSE: $ zypper install nodejs npm

Formatter

Formatting is handled using the doom-module::editor format module via prettier.

TODO Usage

󱌣 This module has no usage documentation yet. Write some?

TODO Configuration

󱌣 This module has no configuration documentation yet. Write some?

Troubleshooting

There are no known problems with this module. Report one?

Frequently asked questions

This module has no FAQs yet. Ask one?

TODO Appendix

󱌣 This module has no appendix yet. Write one?