threeapples307 / closure-linter

Automatically exported from code.google.com/p/closure-linter
Apache License 2.0
0 stars 0 forks source link

Optional Parameter Tag marked as error #54

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. document a parameter with a default value
2. @param {String} [accessLevel] The user accessLevel is optional.
3. Run the linter

What is the expected output? What do you see instead?
I expect no error.  Instead it says Parameter mismatch: got accessLevel, 
expected The

What version of the product are you using? On what operating system?
latest (2012-09-27)

Please provide any additional information below.
This was a valid syntax according to this spec
http://code.google.com/p/jsdoc-toolkit/wiki/TagParam

Also fails on optional parameter with default value:
@param {String} [accessName="root"] The user accessLevel is optional.

Original issue reported on code.google.com by mbrin...@gmail.com on 28 Sep 2012 at 5:23

GoogleCodeExporter commented 9 years ago
The Closure Linter enforces Google's JavaScript style guide. This style guide 
explicitly differs from what is legal jsdoc toolkit syntax and this behavior is 
working as intended. Internally we do not want to support this syntax.

That said, I recognize that it would be nice if we played nice with this syntax 
for the open source Closure Linter since users of the linter can benefit from 
it without sticking 100% to the Google JavaScript style guide. Considering this 
a low priority feature request to support jsdoc @param syntax for non-Google 
users of the Closure Linter

The Google style guide can be found here: 
http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml

Original comment by a...@google.com on 5 Aug 2013 at 9:31