The yarn package manager suggests a snippet of elisp to use:
Create a .dir-locals.el with the following content to enable Flycheck and LSP support and make sure LSP is loaded after local variables are applied to trigger the eval-after-load:
((typescript-mode . ((eval . (let ((project-directory (car (dir-locals-find-file default-directory)))) (setq lsp-clients-typescript-server-args `("--tsserver-path" ,(concat project-directory ".yarn/sdks/typescript/bin/tsserver") "--stdio"))))))) When I create the .dir-locals.el file and open it I see the following warning:
‘(typescript-mode (eval let ((project-directory (car (dir-locals-find-file default-directory)))) (setq lsp-clients-typescript-server-args `("--tsserver-path" ,(concat project-directory ".yarn/sdks/typescript/bin/tsserver") "--stdio"))))’ is a malformed function Is this a malformed function?
If so then in what way is it malformed?
Major modes:
Emacs-Lisp, ElDoc Enabled minor modes:
Auto-Composition Auto-Compression Auto-Encryption Company Counsel-Projectile Delete-Selection Diff-Hl Diff-Hl-Flydiff Drag-Stuff Drag-Stuff-Global Editorconfig Electric-Indent File-Name-Shadow Flycheck Font-Lock Global-Auto-Revert Global-Company Global-Diff-Hl Global-Eldoc Global-Font-Lock Global-Git-Commit Global-Hl-Line Global-Page-Break-Lines Global-Undo-Tree Ivy Key-Chord Line-Number Linum Magit-Auto-Revert Mouse-Wheel Page-Break-Lines Projectile Shell-Dirtrack Show-Paren Smartparens Smartparens-Global Tooltip Transient-Mark Undo-Tree Volatile-Highlights Which-Key Yas Yas-Global
flycheckor similar). If you try to evaluate this, then you should get an "illegal function" error, since you are trying to call something which is not a function. What's the buffer that contains this code when you look at it and what major/minor modes are enabled on it? DoC-h mto find out and edit your question with the additional information.flycheck.