From 3afb088940eb0a51f0105625fb4c74ca4e789f9f Mon Sep 17 00:00:00 2001 From: Kevin Ji <1146876+kevinji@users.noreply.github.com> Date: Mon, 30 May 2022 17:08:45 -0700 Subject: [PATCH] [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. --- layers/+lang/javascript/packages.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layers/+lang/javascript/packages.el b/layers/+lang/javascript/packages.el index b4ba40277..ecf9d0163 100644 --- a/layers/+lang/javascript/packages.el +++ b/layers/+lang/javascript/packages.el @@ -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)