jscs-dev / jscs-jsdoc

JsDoc validation rules for jscs
MIT License
99 stars 35 forks source link

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

Open blazkovicz opened 8 years ago

blazkovicz commented 8 years ago

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"
      ]
    }
  }
qfox commented 8 years ago

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

blazkovicz commented 8 years ago

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

qfox commented 8 years ago

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!