Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jsdoc): add more checks to valid-jsdoc rule #7

Merged
merged 1 commit into from Nov 8, 2016

Conversation

cwillisf
Copy link
Contributor

BREAKING CHANGE: Added stricter options from http://eslint.org/docs/rules/valid-jsdoc

Copy link
Contributor

@rschamp rschamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with this — @thisandagain @tmickel?

@cwillisf
Copy link
Contributor Author

cwillisf commented Oct 25, 2016

To enumerate the actual changes here:

  • When documenting function parameters, you must now use @param instead of @arg or @argument. Previously any of the three would be accepted.
  • When documenting a class constructor, you must now use @constructor instead of @class. Previously either would be accepted.
  • When documenting an abstract class, you must now use @abstract instead of @virtual. Previously either would be accepted.
  • When documenting a function parameter, return value, etc. of type boolean, number, object, or string, you must use those names. The names of the corresponding wrapper types -- Boolean, Number, Object, and String -- are no longer allowed.
  • The documentation for each parameter must include a description.
  • If you document a return value for your function, your documentation must include the value's type and a description.

Things which have not changed:

  • JSDoc comments are not required.
  • A function which has a JSDoc comment and includes a return statement must document its return value. If the function has a JSDoc comment but doesn't include a return statement, then it's not required to document the return value.
  • If a function documents a return value, it must use @return. The synonym @returns is not allowed.

@tmickel
Copy link

tmickel commented Oct 25, 2016

All sounds good to me!

@rschamp
Copy link
Contributor

rschamp commented Oct 25, 2016

@cwillisf I meant to include require-jsdoc as a warning but it doesn't seem to be warning. Did you happen to look at why that is?

Found out why: eslint/eslint#5867. Maybe a (weak) argument to change the decision on function definition style?

@tmickel tmickel removed their assignment Oct 25, 2016
@thisandagain
Copy link
Contributor

Looks great to me. Thanks @cwillisf

@cwillisf cwillisf merged commit be9abcd into scratchfoundation:master Nov 8, 2016
@cwillisf cwillisf deleted the get-picky-about-jsdoc branch November 8, 2016 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants