newer linter does not complain about missing description in return statements.

38 views
Skip to first unread message

Stefan Liebenberg

unread,
Jun 25, 2013, 6:31:25 AM6/25/13
to closure-lin...@googlegroups.com
 I did a quick search of the group on this, and didn't find anything, so I apologise if this has been discussed before.

At work everyone is using a different version of the linter and it seems that the newer versions don't complain about missing descriptions in @return tags.

     [exec] Line 125, E:0214: Missing description in @return tag
     [exec] Line 134, E:0214: Missing description in @return tag

Is this a bug in the newer versions?

Regards, Stefan




Tyler Breisacher

unread,
Jun 25, 2013, 12:57:42 PM6/25/13
to closure-lin...@googlegroups.com
I believe that's an intentional change. It is not necessary to include a description in the @param/@return, if it's obvious from the names: If you have

/**
 * @param {string} id The element id
 * @return {Element} The element whose id is 'id'
 */
getElementById = function(id) {...

you can change it to just

/**
 * Gets the element with the specified id.
 * @param {string} id
 * @return {Element}
 */
getElementById = function(id) {...

since the method name and param name make it fairly obvious what the param and return value mean.

Of course, if the names do not provide all the information, you should still include more explanation :)





--
You received this message because you are subscribed to the Google Groups "Closure Linter Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-linter-di...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Stefan Liebenberg

unread,
Jun 25, 2013, 1:11:43 PM6/25/13
to closure-lin...@googlegroups.com
Cool thanks.

Is there maybe an option on the linter that would enforce the old behaviour?

Andy Perelson

unread,
Jun 27, 2013, 2:16:29 PM6/27/13
to closure-lin...@googlegroups.com
Not today. Feel free to file a feature request for it as an optional check.


Reply all
Reply to author
Forward
0 new messages