lang/javascript: remove eslint_d detection
This is now left to the user's private config.
This commit is contained in:
parent
929482a883
commit
c4396226dd
1 changed files with 5 additions and 14 deletions
|
@ -9,7 +9,11 @@
|
||||||
js-chain-indent t
|
js-chain-indent t
|
||||||
;; let flycheck handle this
|
;; let flycheck handle this
|
||||||
js2-mode-show-parse-errors nil
|
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
|
(add-hook! 'js2-mode-hook
|
||||||
#'(flycheck-mode rainbow-delimiters-mode +javascript|add-node-modules-path))
|
#'(flycheck-mode rainbow-delimiters-mode +javascript|add-node-modules-path))
|
||||||
|
@ -27,19 +31,6 @@
|
||||||
;; If it's available globally, use eslint_d
|
;; If it's available globally, use eslint_d
|
||||||
(setq flycheck-javascript-eslint-executable (executable-find "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
|
(map! :map js2-mode-map
|
||||||
:localleader
|
:localleader
|
||||||
:nr "r" #'+javascript/refactor-menu
|
:nr "r" #'+javascript/refactor-menu
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue