jscs-jsdoc icon indicating copy to clipboard operation
jscs-jsdoc copied to clipboard

Is there a way to switch off jsdoc enforceExistence for anonymous arrow functions?

Open blazkovicz opened this issue 9 years ago • 3 comments

Jscs "2.10.1" requires jsdoc for any anonymous arrow function. It's very inconvenient to write jsdoc for functions inside Array.sort, Array.map, Array.filter etc.

Example:

1

Next config does not help:

"jsDoc": {
    "enforceExistence": {
      "allExcept": [
        "expressions",
        "paramless-procedures"
      ]
    }
  }

blazkovicz avatar Mar 03 '16 12:03 blazkovicz

Looks like you are looking for 'arrow': https://github.com/jscs-dev/jscs-jsdoc/blob/master/lib/rules/validate-jsdoc/enforce-existence.js#L19

qfox avatar Mar 03 '16 23:03 qfox

Thank you, I thought that option 'anonymous': false should cover my case. Is it supported fully, because official docs don't contain this option?

blazkovicz avatar Mar 04 '16 05:03 blazkovicz

Uhm, yeah, it's supported. It's excepted by default as I see, but if you specify another exception it's reenabled. I think all be fine if you will add 'anonymous' to your exceptions list.

And yes, it's a problem with docs. Thanks!

qfox avatar Mar 04 '16 10:03 qfox