             "--stdin-filename"
             ,buffer-file-name
             "--ext"
-            ".json,.js,.jsx,.mjs,.mjsx,.cjs,.cjsx,.ts,.tsx")
+            ".json,.js,.jsx,.mjs,.cjs,.cjsx,.ts,.tsx")
     :output-processor (lambda (output-file result-callback)
                         (let* ((data (ignore-error 'json-end-of-file (json-read-file output-file)))
                                (output (and data (arrayp data) (alist-get 'output (aref data 0)))))

            "--stdin-filename"
            ,buffer-file-name
            "--ext"
            ".json,.js,.jsx,.mjs,.mjsx,.cjs,.cjsx,.ts,.tsx")))

(dolist (mode '(css-mode js-mode markdown-mode scss-mode typescript-mode web-mode yaml-mode))
  (let ((mode-hook (intern (concat (symbol-name mode) "-hook"))))

                                                 (lsp--workspace-server-id lsp--cur-workspace))))))))
                    (if (or yarn-pnp-p (executable-find "yarn"))
                        (progn
                          (define-key (symbol-value (derived-mode-map-name mode)) (kbd "C-c f") 'yarn-eslint-format-buffer)
                          (yarn-eslint-format-on-save-mode))
                      (progn
                        (define-key (symbol-value (derived-mode-map-name mode)) (kbd "C-c f") 'eslint-format-buffer)
                        (eslint-format-on-save-mode))))
                   ((eq formatter 'prettier)
                    (use-package prettier
                      :delight
                      :config
                      (prettier-mode)
                      (define-key (symbol-value (derived-mode-map-name mode)) (kbd "C-c f") 'prettier-prettify)))))))))

;; Javascript
(add-hook 'js-mode-hook
          (lambda ()
            (pcase-dolist (`(,key . ,command)
                           '(("M-."     . nil)
                             ("C-c M-:" . nil)
                             ("C-c C-j" . nil)
                             ("C-M-x"   . nil)
                             ("<menu-bar>" . nil)))
              (define-key js-mode-map (kbd key) command))))

(use-package import-js
  :after (js)
  :bind (:map js-mode-map
              ("C-c t i"   . import-js-import)
              ("C-c t f"   . import-js-fix)
              ("C-c t M-." . import-js-goto))
  :config (run-import-js))

(use-package js-doc
  :after (js)
  :bind (:map js-mode-map
              ("C-c C-d m" . js-doc-insert-file-doc)
              ("C-c C-d f" . js-doc-insert-function-doc-snippet)))

(use-package nodejs-repl
  :after (js)
  :bind(:map js-mode-map
             ("C-c e e" . nodejs-repl-send-last-expression)
             ("C-c e r" . nodejs-repl-send-region)
             ("C-c e b" . nodejs-repl-send-buffer)
             ("C-c e l" . nodejs-repl-load-file)
             ("C-c M-:" . nodejs-repl-switch-to-repl)))

(use-package js2-mode
  :interpreter ("node" . js2-mode)
