question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

valid-jsdoc for option objects

See original GitHub issue

Given code as such:

/**
 * Some description.
 * @param {Object} s State.
 * @param {boolean} opts.reverse Is reverse?
 * @param {Array.<Natural>} opts.exclude List of ids to exclude.
 * @return {Object} New state.
 */
function getPreviewState(s, opts) {}

The valid-jsdoc rule (as of ESLint 3.7.0) using the default setting currently tells me that I’m missing a param for opts. However, I was hoping it would recognize opts.* as covering that case. Is this something that could be supported? As it stands adding a @param {Object} opts Options. line gets rid of the warning.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wavdedcommented, Oct 10, 2016

I’m OK with keeping things the way they are so good to close IMO.

0reactions
kaicataldocommented, Oct 9, 2016

@wavded Has this been resolved by our discussion above? Want to make sure you’re good before we close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

valid-jsdoc - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Use JSDoc: @param
If a parameter is destructured without an explicit name, you can give the object an appropriate one and document its properties. Documenting a...
Read more >
ESLint - valid-jsdoc - The --fix option on the command line can ...
This rule enforces valid and consistent JSDoc comments. It reports any of the following problems: missing parameter tag: @arg , @argument , or...
Read more >
JSDoc Reference - TypeScript: Documentation
@typedef , @callback , and @param ; @param {Object} options - The shape is the same as SpecialType above. * @param {string} options.prop1...
Read more >
How to describe "object" arguments in jsdoc? - Stack Overflow
In this case a @typedef comes in very handy. You can define the type at one point in your source and use it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found