jscs-dev / jscs-jsdoc

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

enforceExistence rule not work properly for anonymous function. #189

Closed annsk closed 8 years ago

annsk commented 8 years ago

For function in this code jscs throw error. It should be param for suppress it.

var modalInstance = $modal.open({
         templateUrl: 'modalColor.html',
         controller: 'ModalColorCtrl as mColor',
         resolve   : {
                colors: function() {
                        return 1;
                }
         }
});
qfox commented 8 years ago

What the config you have?

Did you tried "enforceExistence": {"allExcept": ["expressions", "paramless-procedures"]}?

See also: http://jscs.info/rule/jsDoc#enforceexistence

annsk commented 8 years ago

Ok, it works. I'd old version. But now I have next problem.

In my config I has:

"disallowSpaceAfterObjectKeys": { "allExcept": ["aligned", "singleline"] },
"requireAlignedObjectValues": "all",

But here:

White: {
      outer: 'NONE',
      inner: 'NONE',
      core : 'WHITE'
}

I got an error: Illegal space after key (in line with key "core").

qfox commented 8 years ago

Thanks for report, that's a known bug: https://github.com/jscs-dev/node-jscs/issues/2080, but it doesn't belongs to jscs-jsdoc.

If you have any other question, feel free to ask ;-)