diff --git a/modules/lang/javascript/config.el b/modules/lang/javascript/config.el index 69a261bce..d5204cc8c 100644 --- a/modules/lang/javascript/config.el +++ b/modules/lang/javascript/config.el @@ -9,7 +9,11 @@ js-chain-indent t ;; let flycheck handle this js2-mode-show-parse-errors nil - js2-mode-show-strict-warnings nil) + js2-mode-show-strict-warnings nil + ;; Flycheck provides these features, so disable them: + ;; conflicting with the eslint settings. + js2-strict-trailing-comma-warning nil + js2-strict-missing-semi-warning nil) (add-hook! 'js2-mode-hook #'(flycheck-mode rainbow-delimiters-mode +javascript|add-node-modules-path)) @@ -27,19 +31,6 @@ ;; If it's available globally, use eslint_d (setq flycheck-javascript-eslint-executable (executable-find "eslint_d")) - (defun +javascript|init-flycheck-eslint () - "Favor local eslint over global installs and configure flycheck for eslint." - (when (derived-mode-p 'js-mode) - (when-let* ((exec-path (list (doom-project-expand "node_modules/.bin"))) - (eslint (executable-find "eslint"))) - (setq-local flycheck-javascript-eslint-executable eslint)) - (when (flycheck-find-checker-executable 'javascript-eslint) - ;; Flycheck has it's own trailing command and semicolon warning that was - ;; conflicting with the eslint settings. - (setq-local js2-strict-trailing-comma-warning nil) - (setq-local js2-strict-missing-semi-warning nil)))) - (add-hook 'flycheck-mode-hook #'+javascript|init-flycheck-eslint) - (map! :map js2-mode-map :localleader :nr "r" #'+javascript/refactor-menu