0

I have the following valid javascript with trailing comma in function parameters:

const a = (...params) => console.log(params);
a(
  1,
  2,
  3,
);

But in js2-mode I see the error missing ) after argument list. Here is the screenshot of my emacs window - https://i.stack.imgur.com/GFuBM.png

There is issue about that and PR for js2-mode on github:

As you can see on the screenshot I have the latest js2-mode with code from this PR.

Why do I still get this error? How can I fix or debug it? Any help is appreciated

Edit 0: How to reproduce this in clean environment?

  1. start clean emacs in docker using docker run --rm -ti jare/emacs emacs -nw
  2. install js2-mode: M-x package-install RET js2-mode
  3. create empty buffer, enable M-x js2-mode, type same text as in example
  4. see the same error - https://i.stack.imgur.com/NYU6s.png
  • It works fine for me. Do you have flycheck enabled or any other linter? – caisah Sep 29 '17 at 20:31
  • Yes it was enabled at that time. Disabled it and edited code - still got this error – Oles Savluk Sep 29 '17 at 22:21
  • @caisah I've updated question with steps to reproduce this issue in a clean environment. Are you sure it works for you? Maybe you have js2-mode disabled at all? – Oles Savluk Sep 29 '17 at 23:38
0

Appeared that this feature was not yet supported by js2-mode, but my PR #454 was merged and should be available soon.

If you want to use it right now - the latest version is available on github. If you are using spacemacs - add this lines to .spacemacs file:

dotspacemacs-additional-packages 
  '((js2-mode :location (recipe :fetcher github :repo "mooz/js2-mode")))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.