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

Update inline documentation to use official jsdoc type definitions #287

Closed
2 of 6 tasks
Destreyf opened this issue Dec 31, 2016 · 2 comments · Fixed by #336
Closed
2 of 6 tasks

Update inline documentation to use official jsdoc type definitions #287

Destreyf opened this issue Dec 31, 2016 · 2 comments · Fixed by #336

Comments

@Destreyf
Copy link
Contributor

What type of issue are you creating?

  • Bug
  • Enhancement
  • Question

What version of this module are you using?

  • 2.0.10 (Stable)
  • 2.1.0-rc.7 (2.1 Release Candidate 7)
  • Other

Write other if any:

Please add a description for your issue:

Right now the SDK generates sections like this

  /**
   * ...
   * @param any id User id
   * @param any fk Foreign key for credentials
   * ...
   */

However in my IDE that leaves indicators like this
image

Note the yellow lines on the side this isn't a huge issue but it'd be nice to not have thousands of jsdoc errors in my editor when doing checks 😛

the proper syntax in jsdoc to indicate type would look like this

  /**
   * ...
   * @param {any} id User id
   * @param {any} fk Foreign key for credentials
   * ...
   */

It should be as simple as wrapping curly braces around the type portion.

Here's MS's official documentation on it: JSDoc support in JavaScript - Microsoft/TypeScript Wiki

It appears to be pretty straight forward to implement, if i find some free time this weekend i'll likely submit a PR for this.

@Destreyf
Copy link
Contributor Author

Another cleanup item could be to remove the

let result = ...; 
return result;

As its not necessary to define the variable and immediately return it.

@jonathan-casarrubias
Copy link
Collaborator

Hi @Destreyf, thanks for reporting this issue.

Hey so, the let result reference is created because in some scenarios there is extra code between result declaration and return, anyway... I believe it would be good idea not to create the reference when there is nothing to do with it, like mapping it or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants