From 7040490859f5c771c45bcf147d9e2b57f0117d9e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Jun 2017 22:53:42 +0200 Subject: Emacs: Support nodeJS projects in projectile --- emacs/.emacs.d/init.org | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index 645bdcd..81cba44 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -570,7 +570,17 @@ ones. (expand-file-name project-dir (ghq--find-root)) arg))) (setq projectile-switch-project-action #'projectile-commander - projectile-completion-system 'ivy))) + projectile-completion-system 'ivy + projectile-create-missing-test-files t) + + (defun ap/projectile-test-suffix (project-type) + (cond + ((member project-type '(node-yarn node-npm)) ".test") + (t (projectile-test-suffix project-type)))) + (setq projectile-test-suffix-function #'ap/projectile-test-suffix) + + (projectile-register-project-type 'node-yarn '("yarn.lock") "yarn start" "yarn test") + (projectile-register-project-type 'node '("package.json") "npm start" "npm test"))) (use-package counsel-projectile :after (counsel projectile) -- cgit 1.4.1