closure-linter
closure-linter copied to clipboard
Optional Parameter Tag marked as error
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 [email protected] on 28 Sep 2012 at 5:23
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 [email protected] on 5 Aug 2013 at 9:31
- Added labels: Priority-Low, Type-Enhancement
- Removed labels: Priority-Medium, Type-Defect