jscs-dev / jscs-jsdoc

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

Need way to enforce existence of methods #13

Closed daprahamian closed 10 years ago

daprahamian commented 10 years ago

My team would like to use jscs-jsdoc. However, we generally have a coding practice that involves both using anonymous functions to create our methods, and using frameworks like Backbone, Marionette, and underscore to create our object prototypes. With this in mind, is there any way to create a rule that either allows you to enforce the existence of jsdoc on anonymous functions, or perhaps to do so when anonymous functions are members of objects?

qfox commented 10 years ago

Sorry for delayed answer.

Can you try to use {"jsDoc": {"enforceExistance": true}} flag?

It should work for any (anonymous/properties/variables) function declarations. But please report if it doesn't :-)

qfox commented 10 years ago

Just fyi: fixed bug with object members. Now it should report not only named function but also:

var func = function () { }; // this
func.prototype.bar = function () { }; // and this

Thanks!

qfox commented 10 years ago

Just published updated version to npm. It should works now as expected.

qfox commented 10 years ago

Issue is about the same as #21

qfox commented 10 years ago

@daprahamian I'm closing this for now. Tell me please if you'll find some inaccuracy in realization. Thanks for contribute!