From a4392b2c0d28216398569083df014ca9906d0ebf Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 14 Dec 2020 16:50:40 -0500 Subject: [PATCH] Fix #4431: don't use // in [JT]SX markup --- modules/lang/web/+html.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/lang/web/+html.el b/modules/lang/web/+html.el index 81f2f88b4..8188d0c12 100644 --- a/modules/lang/web/+html.el +++ b/modules/lang/web/+html.el @@ -65,12 +65,9 @@ (add-to-list 'web-mode-engines-alist '("elixir" . "\\.eex\\'")) - (let ((types '("javascript" "jsx"))) - (setq web-mode-comment-formats - (cl-remove-if (lambda (item) (member (car item) types)) - web-mode-comment-formats)) - (dolist (type types) - (push (cons type "//") web-mode-comment-formats))) + ;; Use // instead of /* as the default comment delimited in JS + (setf (alist-get "javascript" web-mode-comment-formats nil nil #'equal) + "//") (add-hook! 'web-mode-hook (defun +web--fix-js-comments-h ()