js-doc icon indicating copy to clipboard operation
js-doc copied to clipboard

does not work for variation of function declaration styles. Eg JSX/React/class style functions

Open vladp opened this issue 9 years ago • 0 comments

most of my functions are in form

function funcName (attr1, attr2) { return attr1; }

or

var RClassNm = React.CreateClass({

getState: function () { }

});

The js-doc module does not appear to work for any of them.

When I type M-x js-doc-insert-function-doc I see comments appearing with a body of another function up in the file.

I use emacs 25.0.93.1 Fedora 23 Linux And I have installed a number of Javascript related helpers that understand Syntax structure of javascript files very well

 (setq flycheck-checkers '(javascript-eslint))
  ;; use eslint with web-mode for jsx files
  (flycheck-add-mode 'javascript-eslint 'web-mode)
  (flycheck-add-mode 'javascript-eslint 'js2-mode)
  (flycheck-add-mode 'javascript-eslint 'js-mode)
  ;; disable json-jsonlist checking for json files
  (setq-default flycheck-disabled-checkers
                (append flycheck-disabled-checkers
                        '(json-jsonlist)))
  )

I suspect the regex based methods within js-lint prevent it from working in the above scenarios.

vladp avatar May 12 '16 00:05 vladp