[javascript] Use js2-mode with .cjs files

.cjs is an extension for CommonJS files, and is needed if `"type": "module"` is specified for a Node package.
This commit is contained in:
Kevin Ji 2022-05-30 17:08:45 -07:00 committed by Maxi Wolff
parent 11277c517c
commit 3afb088940

View file

@ -112,7 +112,7 @@
(defun javascript/init-js2-mode ()
(use-package js2-mode
:defer t
:mode (("\\.m?js\\'" . js2-mode))
:mode (("\\.[cm]?js\\'" . js2-mode))
:init
(progn
(add-hook 'js2-mode-local-vars-hook #'spacemacs//javascript-setup-backend)