From 61af1478494fb748f7f55c6e2253a7a35d663cd1 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 20 Nov 2021 15:21:35 +0100 Subject: [emacs] use NVM environment installed at nvm-dir /.nvm Signed-off-by: Markus Heiser --- .dir-locals.el | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '.dir-locals.el') diff --git a/.dir-locals.el b/.dir-locals.el index b8f7ecc76..e1d0b8ef7 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -19,6 +19,7 @@ ;; Some buffer locals are referencing the project environment: ;; ;; - prj-root --> / +;; - nvm-dir --> /.nvm ;; - python-environment-directory --> /local ;; - python-environment-default-root-name --> py3 ;; - python-shell-virtualenv-root --> /local/py3 @@ -57,6 +58,9 @@ (setq-local python-environment-directory (expand-file-name "./local" prj-root)) + ;; to get in use of NVM enviroment, install https://github.com/rejeep/nvm.el + (setq-local nvm-dir (expand-file-name "./.nvm" prj-root)) + ;; use 'py3' enviroment as default (setq-local python-environment-default-root-name "py3") @@ -90,6 +94,8 @@ (js-mode . ((eval . (progn + ;; flycheck should use the (local) NVM environment (see nvm-dir) + (nvm-use-for-buffer) (setq-local js-indent-level 2) ;; flycheck should use the eslint checker from simple theme (setq-local flycheck-javascript-eslint-executable -- cgit v1.2.3 From 5242a841a5dd2179d1ed620a67594932eb129422 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 20 Nov 2021 17:00:07 +0100 Subject: [mod] NVM: dev-tools pre-installed in NVM's node installation The Node.js installation in the NVM environment can be used by IDEs and other developer tasks. The required developer packagaes are added to the file ./.nvm_packages and will be installed when Node.js is installed. Initial we start with: - eslint Having a dedicated developer enviroment, provided by nvm makes it easy to integrate Node.js packages into various IDEs. One example is shown in the .dir-locals.el which is used by emacs. [1] https://github.com/nvm-sh/nvm#default-global-packages-from-file-while-installing [2] https://eslint.org Signed-off-by: Markus Heiser --- .dir-locals.el | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to '.dir-locals.el') diff --git a/.dir-locals.el b/.dir-locals.el index e1d0b8ef7..f67ab4714 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -94,12 +94,9 @@ (js-mode . ((eval . (progn - ;; flycheck should use the (local) NVM environment (see nvm-dir) + ;; use nodejs from the (local) NVM environment (see nvm-dir) (nvm-use-for-buffer) (setq-local js-indent-level 2) - ;; flycheck should use the eslint checker from simple theme - (setq-local flycheck-javascript-eslint-executable - (expand-file-name "searx/static/themes/simple/node_modules/.bin/eslint" prj-root)) (flycheck-mode) )))) -- cgit v1.2.3